Python Paho Mqtt error cannot connect to thing on AWS IoT
See original GitHub issueI am facing problems, when trying to connect to AWS IoT via python. My code worked previously so there isn’t anything I can change there, I suspect there is something on AWS side probably ? As you can see at the last line I am having SSL problems.
Traceback (most recent call last): File "flint.py", line 44, in <module> mqttc.connect("a2yye602yte99c.iot.us-west-2.amazonaws.com", port=8883) #AWS IoT service hostname and portno File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 686, in connect return self.reconnect() File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 821, in reconnect ciphers=self._tls_ciphers) File "/usr/lib/python2.7/ssl.py", line 891, in wrap_socket ciphers=ciphers) File "/usr/lib/python2.7/ssl.py", line 566, in __init__ self.do_handshake() File "/usr/lib/python2.7/ssl.py", line 788, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ssl.c:581)
Also yesterday when the error popped in for the first time, there was some notification on AWS IoT console :
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Hello @embRTS , in case your certificate is in pending mode then it is not possible to connect to AWS (SSL encryption works this way, your first have to get authenticated that you are who you are pretending to be and afterwards you exchange data) . I am guessing you cannot even telnet AWS. Why don’t you just create another certificate, in case this is the problem ?
In my case it was some DNS issue that appeared only when I was trying to connect with AWS using WI-FI bundle. Fixed it by changing some configurations in my router.
Regards,
Kejsi
I had the same problem with “SSLV3_ALERT_CERTIFICATE_UNKNOWN” because the certificate was not active on AWS IoT console. Once I activated it paho is working just fine