0

PEM file for Adafruit.io
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PEM file for Adafruit.io

by jaada on Sun Jul 08, 2018 12:02 pm

Hi,

I'm trying to run a MQTT client on a Raspberry PI that's requiring a .pem ca file to enable TLS.

I'm at a loss on how to do this. Any suggestions?

Thank you in advance!

jaada
 
Posts: 2
Joined: Mon Mar 12, 2018 4:02 am

Re: PEM file for Adafruit.io

by brubell on Mon Jul 09, 2018 10:26 am

Are you trying to connect the Pi to Adafruit IO?

Could you provide a link to the library and your implementation.

If you want a MQTT Library/Client that works with Adafruit IO, consider importing the IO-Client-Python's `mqtt_client.py` (https://github.com/adafruit/io-client-python) into your python script.

brubell
 
Posts: 68
Joined: Fri Jul 17, 2015 10:33 pm

Re: PEM file for Adafruit.io

by jaada on Mon Jul 09, 2018 10:47 am

Thank you so much for the reply!

I’m using the following code:


https://github.com/jpwsutton/status/blo ... /status.py

jaada
 
Posts: 2
Joined: Mon Mar 12, 2018 4:02 am

Re: PEM file for Adafruit.io

by brubell on Mon Jul 09, 2018 11:37 am

No problem! You seem to be using the same MQTT client library as we do in io-client-python (paho mqtt)

Instead of using the ca file, we can do a call to self._client.tls_set_context() (https://github.com/eclipse/paho.mqtt.py ... et_context)

Here's the implementation we went with:
https://github.com/adafruit/io-client-p ... ent.py#L58

brubell
 
Posts: 68
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.