aws-samples / aws-iot-device-management-workshop

AWS IoT Device Management makes it easy to securely onboard, organize, monitor, and remotely manage IoT devices at scale. With this workshop your will learn hands-on the features from AWS IoT Device Management like several onboarding options, jobs, fleet indexing, thing groups and fine grained logging.
Apache License 2.0
66 stars 36 forks source link

MQTT connection failure ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720) #3

Closed itsharshgandhi-ub closed 5 years ago

itsharshgandhi-ub commented 5 years ago

I am trying to connect to IoT using job-agent.py script. It is running fine on my MacBook as a IoT thing but it is throwing error on my Raspberry Pi as a thing. Can you help me out with this?

Error:

Traceback (most recent call last): File "/home/pi/ruxin/jobAgent.py", line 194, in myAWSIoTMQTTClient.connect() File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/MQTTLib.py", line 513, in connect return self._mqtt_core.connect(keepAliveIntervalSecond) File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 196, in connect self.connect_async(keep_alive_sec, self._create_blocking_ack_callback(event)) File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 223, in connect_async raise e File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 211, in connect_async rc = self._internal_async_client.connect(keep_alive_sec, ack_callback) File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/internal/clients.py", line 122, in connect rc = self._paho_client.connect(host, port, keep_alive_sec) File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 665, in connect return self.reconnect() File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 826, in reconnect ciphers=self._tls_ciphers) File "/usr/lib/python3.5/ssl.py", line 1077, in wrap_socket ciphers=ciphers) File "/usr/lib/python3.5/ssl.py", line 760, in init self.do_handshake() File "/usr/lib/python3.5/ssl.py", line 996, in do_handshake self._sslobj.do_handshake() File "/usr/lib/python3.5/ssl.py", line 641, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)