• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

MQTT security

Q&A Forum › Category: ESP32 › MQTT security
0 Vote Up Vote Down
sialaichai asked 6 years ago

The example on using MQTT for ESP32 does not incorporate any security. How do I incorporate some security in the messages so that only the authorized subscribers are allowed to read the messages. 

Question Tags: ESP32 MQTT
3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hello,
I have a thread on the Forum that you can use as a reference: https://rntlab.com/question/how-to-use-cloud-mqtt-broker-with-esp32-using-async-mqtt-client-library/

In summary, you need to do the following. In the setup() function, you need to call the .setCredentials() method with your own username and password (MQTT broker):

mqttClient.setCredentials("zkk-----", "BtH------");

I hope that helps.

Regards,
Rui

0 Vote Up Vote Down
Jader Rosa answered 3 years ago

username and password is still insecure if sent in plain text over an unencrypted connection. I found that in the course “Learn ESP32 with Arduino IDE – 2nd Edition” in the MQTT part, a chapter was missing showing connection via SSL with username and password. Here’s a tip for an update

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Thanks for the suggestion.
At the moment, we don’t have any tutorials about connection via SSL. We need to work on that.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.