Establish a secure MQTT connection to a broker using TLS on an ESP32
@Middleware & OS
Hello everyone, I have a code that I'm trying to use to establish a secure MQTT connection to a broker using TLS on an ESP32. However, I keep getting an undefined error when calling
espClient.setCACert(test_root_ca)
. In order to fix this error, I need to generate a CA certificate using
and replace "YOUR_CA_CERTIFICATE_HERE" with the generated certificate. Can anyone help me with this issue? Thank you.
Here's the code I'm using:
Solution:Jump to solution
@Boss lady your code looks correct to me and should run perfectly well without any issues once all required parameters are field, just in case this is what it looked like once I tried it out
```cpp
#include <WiFi.h>
#include <WiFiClientSecure.h>
...
1 Reply
Solution
@Boss lady your code looks correct to me and should run perfectly well without any issues once all required parameters are field, just in case this is what it looked like once I tried it out