Connection refused error - ADSB - Python script

Hi,

We are getting below error when we try to access ADS-B feed through through Python script. We are able to execute with OpenSSL but not through Python.
Kindly help us in this.

Error :
=========== RESTART: C:\Users\E356488\Desktop\Python\adsb_feed.py ===========
Connecting…
Traceback (most recent call last):
File “C:\Users\E356488\Desktop\Python\adsb_feed.py”, line 35, in
ssl_sock.connect((‘firehose.flightaware.com’, 1501))
File “C:\Users\E356488\AppData\Local\Programs\Python\Python35-32\lib\ssl.py”, line 1014, in connect
self._real_connect(addr, False)
File “C:\Users\E356488\AppData\Local\Programs\Python\Python35-32\lib\ssl.py”, line 1001, in _real_connect
socket.connect(self, addr)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

As long as your python code is using the same hostname and port number that is originally specified in the sample on our website, then it should work if your network and/or firewall are properly configured. Please speak to your IT staff if you need to arrange for your firewall to allow outgoing connections to our server on that port number.


ssl_sock = context.wrap_socket(s, server_hostname ='firehose.flightaware.com')
print("Connecting...")
ssl_sock.connect(('firehose.flightaware.com', 1501))
print("Connection succeeded")


You can also use the “openssl s_client” command that is listed earlier in the documentation page to verify that you can connect to our server’s address.