pubsubclient
pubsubclient copied to clipboard
Added TLS secured MQTT example for ESP32 and Mosquitto communication.
I spent long hours to make working TLS encrypted communication with ESP32 <----> Mosquitto broker (MQTT) also opened for that an issue where others too suffered from a similar problem: arduino-esp32/#5021
I decided to make a useful example, I hope it can be useful in the future, please include it.
The mqtt_ESP32_TLS.ino source file also contains a short manual. The certificates/certificate_generator.sh is an easy tool for generating certificates.
Thanks for your help to integrate it with wifi! Can you also give us an example of use with tinyGsm library when using with some network module? Thanks
Thanks for your help to integrate it with wifi! Can you also give us an example of use with tinyGsm library when using with some network module? Thanks
I dont know tinyGsm library, I cannot help. You must do it on your own.
i'm using your example and an issue occured... error:Unknown error code (0050) state: -2 And i test the mosquitto broker, it work.
i'm using your example and an issue occured... error:Unknown error code (0050) state: -2 And i test the mosquitto broker, it work.
oh sorry, it is server error, port 1883 has been attacked.
hi
I used your script and played arround for quite some time also with PROGMEM etc. I seem to have a problem with the certs and keys.
Following error: X509 - Certificate verification failed, e.g. CRL, CA or signature check failed
I used the exact same ca.crt esp.crt and esp.key with testing tool MQTT.fx where it works, also working on Raspberry pi.
Maybe you can give me a hint!
BR
Please consider merging to to the main branch. That example could be very usefull for people looking for TLS encryption in MQTT communication.