Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    mqtt with ssl

    Scheduled Pinned Locked Moved MicroPython
    4 Posts 3 Posters 296 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Asb
      last edited by

      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/simple.py", 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)?

      A A 2 Replies Last reply Reply Quote 1
      • A Offline
        aen @Asb
        last edited by

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

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          Asb @aen
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • A Offline
            andrethemac @Asb
            last edited by

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

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better đŸ’—

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom