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 RSA certificate questions

    Scheduled Pinned Locked Moved GPy
    1 Posts 1 Posters 11 Views 1 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.
    • techykermitT Offline
      techykermit
      last edited by techykermit

      Hi Pycomers!

      Our company has worked on an integration with the IoT platform ThingsBoard (thingsboard.io) in the recent months. They have different ways of connecting devices, even within MQTT. As our next step, we wanted to try X.509 certificates, because it offers a more secure connection.

      They have a guide here: https://thingsboard.io/docs/paas/user-guide/certificates/.

      If I follow the steps in the guide to generate an RSA-based certificate (see the first command under Step 2. in the link) and use the generated files as certfile and keyfile using umqtt.robust (from MicroPython-lib), I get the following error:

      OSError: [Errno -29312] MBEDTLS_ERR_SSL_CONN_EOF
      

      However, if I instead follow the steps to generate an EC-based certificate (see the second and third command under Step 2. in the link to the guide) and use those files as certfile and keyfile using the same code, the connection works fine.

      So, I solved it by using EC-based certificates instead, but I'm curious why it doesn't work with RSA-based certificates. I assume it either has something to do with the MicroPython/PyCom SSL implementation or how the ThingsBoard server responds back (I'm connecting to their hosted cloud version here). I'm in no way an expert of SSL, so I could be missing something crucial here.

      Might I add that I've tried the RSA based keys that didn't work on the PyCom in an app called "MQTT Explorer" as well as mosquitto_pub and it worked fine. Oh, and by the way, my ca_cert is the one provided by ThingsBoard and I used the same for when trying both RSA and EC certs.

      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