Hello,
I bumped on this very same issue when executing the below (partial) code. The socket create error -8576 showed up upon every attempt of executing the loop:
while not pycomAwsMQTTClient.connect():
print("Waiting for AWS...")
time.sleep(10)
print('AWS connection succeeded!')
Have found that the problem was on the root CA certificate. Just to recap, AWS "setup.py" file expects to work with three certificates as follows:
AWS_ROOT_CA = "/flash/cert/root-CA.crt"
AWS_CLIENT_CERT = "/flash/cert/thing.cert.pem"
AWS_PRIVATE_KEY = "/flash/cert/thing.private.key"
For some reason the root certificate was not created correctly upon instructions from AWS tutorials. To fix that, run the below command line on a Linux Terminal to download it again:
curl https://www.amazontrust.com/repository/AmazonRootCA1.pem > root-CA.crt
By doing so, my issue was fixed.