Python-docs-samples: Error in iot/api-client/mqtt_example/cloudiot_mqtt_example.py

Created on 15 Nov 2017  路  3Comments  路  Source: GoogleCloudPlatform/python-docs-samples

pi@kp-rpi:~/python-docs-samples/iot/api-client/mqtt_example $ python cloudiot_mqtt_example.py --registry_id=my-registry --project_id=kpariani-demo --device_id=my-node-device --algorithm=RS256 --private_key_file=../rsa_private.pem
Creating JWT using RS256 from private key file ../rsa_private.pem
Traceback (most recent call last):
File "cloudiot_mqtt_example.py", line 234, in
main()
File "cloudiot_mqtt_example.py", line 200, in main
args.mqtt_bridge_hostname, args.mqtt_bridge_port)
File "cloudiot_mqtt_example.py", line 111, in get_client
client.tls_set(ca_certs=ca_certs)
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 702, in tls_set
context.load_verify_locations(ca_certs)
IOError: [Errno 2] No such file or directory

Looking at the code, ca_certs seems to be optional so i am not sure why i still run into this.

Most helpful comment

Although the sample parameter is optional, defaulting to roots.pem in the current path, I believe you still will need to retrieve the root certificate from Google e.g. wget https://pki.goog/roots.pem.

All 3 comments

Although the sample parameter is optional, defaulting to roots.pem in the current path, I believe you still will need to retrieve the root certificate from Google e.g. wget https://pki.goog/roots.pem.

Ok i missed that. Should be mentioned in the README

Fixed in #1225

Was this page helpful?
0 / 5 - 0 ratings