esp32-mqtt | ESP32 MQTT sample project
kandi X-RAY | esp32-mqtt Summary
kandi X-RAY | esp32-mqtt Summary
ESP32 MQTT sample project for
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of esp32-mqtt
esp32-mqtt Key Features
esp32-mqtt Examples and Code Snippets
Community Discussions
Trending Discussions on esp32-mqtt
QUESTION
I'm working with an ESP32 and an MQTT Server to create a meteo station. I managed to connect the esp32 to the server without any problem, even outside the local network, and I could post and received messages. So I decide to add some security with SSL and it's certificate, and suddenly, nothing work anymore.
After searching for a bit, I narrowed the problem down : if my esp32 is in the local network, SSL and it's certificate work like a charm. So that obviously means that my certificates are ok, and that my server configuration is probably ok too. But when I try from outside the network, it's the certificates that raises the error. More specifically, it raises :
...ANSWER
Answered 2021-Feb-16 at 10:56SSL certificates are issued to a specific name or IP. When connecting, the certificate's fields (CN or SAN) have to match the name or IP of the target host. Maybe you issued the certificate to an address in your internal LAN like "192.168.0.2" or "mqtt.local". Those work fine for SSL connections inside the LAN since the cert and host name match. If you try to connect from Internet to your public IP or, e.g. "myhome.dyndns.org" it doesn't match the cert's fields. SSL connection is denied. Your cert would have to include those public addresses. MQTT explorer may ignore those errors and ESP not.
QUESTION
I spent hours to to setup the TSL connection for my mosquitto broker in my raspberry. Now I can publish and subscribe topics in a client (on raspberry) using client certificate, client private key and ca certificate. It works correctly.
Now I want to create the client in the ESP32 (IDF platform). I started from the example called ssl_mutual_auth. Unfortunatly in the example is used the client certificate, client private key and a server certificate not the ca certificate. So.. I'm confused and I don't know how to manage the ca.crt file in esp32 client (or Mosquitto client). Do I need to change my certificates or my mosquittos configuration? I used this guide to configure my mosquitto broker : https://medium.com/himinds/mqtt-broker-with-secure-tls-communication-on-ubuntu-18-04-lts-and-an-esp32-mqtt-client-5c25fd7afe67
Here the Mosquitto.conf details where I set the path of certificates:
...ANSWER
Answered 2021-Jan-13 at 09:22The ESP IDF documentation has a bit of a problem with PKI terminology. I'm pretty sure that when they say "server cert" they really mean "any certificate in the chain which validates the server's identity: CA, intermediate, or server cert". They make the same mistake in their HTTPS client docs.
Anyway, just feed your CA cert into the ESP sample project and try it out. Make sure it's in PEM format - check this answer for the details. Convert with openssl if needed.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install esp32-mqtt
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page