aws / aws-iot-device-sdk-python

SDK for connecting to AWS IoT from a device using Python.
Apache License 2.0
681 stars 427 forks source link

Get ssl.SSLError from AWSIoTMQTTClient #161

Closed why702 closed 4 years ago

why702 commented 6 years ago

Hi

I use the following code, but get the ssl.SSLError: unknown error (_ssl.c:3622). Do you know how to find my myClientID? or just use whatever i want? Thx

# AWS IoT certificate based connection
myMQTTClient = AWSIoTMQTTClient("myClientID")
myMQTTClient.configureEndpoint("a24iwim3hyqcyi.iot.us-east-2.amazonaws.com", 8883)
myMQTTClient.configureCredentials("E:/svn/trunk/modules/awsiot/VeriSign-Class3-Public-Primary-Certification-Authority-G5.pem", "E:/svn/trunk/modules/awsiot/1963993965-private.pem.key", "E:/svn/trunk/modules/awsiot/1963993965-certificate.pem.crt")
myMQTTClient.configureOfflinePublishQueueing(-1)  # Infinite offline Publish queueing
myMQTTClient.configureDrainingFrequency(2)  # Draining: 2 Hz
myMQTTClient.configureConnectDisconnectTimeout(10)  # 10 sec
myMQTTClient.configureMQTTOperationTimeout(5)  # 5 sec

#connect and publish
myMQTTClient.connect() --> ssl.SSLError: unknown error (_ssl.c:3622)

Environment: python 3.6 win10 ssl.OPENSSL_VERSION = 'OpenSSL 1.0.2k 26 Jan 2017'

why702 commented 6 years ago

I figure out my problem is my root CA doesn't include "BEGIN CERTIFICATE" and "END CERTIFICATE". When I correct the CA, it's ok.

-----BEGIN CERTIFICATE----- ..... -----END CERTIFICATE-----

github-actions[bot] commented 4 years ago

Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.