mqtt with ssl

  • Hi

    I'm trying to connect to a mqtt server using port 8883, and have the following:

    client = MQTTClient("userX", "XXX", port=8883, user='XXX',password='XXX', ssl=True, ssl_params={'cert_reqs':ssl.CERT_REQUIRED, 'certfile':'cert/ca.pem'})

    Doing a client.connect() gives me:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "umqtt/", line 58, in connect
    OSError: -1

    I'm able to connect to the server from my desktop with a python script. I'm using the same ca.pem file in both cases, do I need a seperate files, is the setup correct (ssl_params)?

  • @Asb I put the full path to the certfile in my config ('certfile':'/flash/cert/ca/pem'}, maybe this helps.

  • @aen No, but I think the problem is with my certificate, unless someone says the initialization is wrong.

  • @Asb No answer to your question.. Did you move past your problem?

Log in to reply

Pycom on Twitter