i am not able to execute.. throws connection refused

Below is the steps I followed:
1. downloaded “Check_heartbleed.txt” to “check_heartbleed.py”
2. moved to “/usr/local/nagios/libexec/”
3. chmod –R 777 check_heartbleed.py

I am getting below error if I execute the script.. any clue on this?

[root@localhost libexec]# ./check_heartbleed.py 10.1.71.49 -p 443
Traceback (most recent call last):
File “./check_heartbleed.py”, line 151, in
main()
File “./check_heartbleed.py”, line 132, in main
s.connect((args[0], opts.port))
File “”, line 1, in connect
socket.error: [Errno 111] Connection refused