thingsboard-client-sdk
thingsboard-client-sdk copied to clipboard
How can I use one-way SSL authentication with ESP32?
hey, does anyone have an example of how to use one-way SSL Authentication with ESP32?
You can use wifisecureclient for that. Instead of passing in the default WiFiClient
construct the thingsboard object with a WiFiSecureClient
like so:
WiFiClientSecure wifi_client;
Thingsboard thingsboard(wifi_client);
...
void setup() {
// if using self-signed set the client to not validate the certificate
wifi_client.setInsecure();
thingsboard.connect("demo.thingsboard.org", "my_token", 8883);
}
pay attention to connect to thingsboard with port 8883. Also you need to have mqtts (mqtt over ssl) enabled in thingsboard.conf. Check the docu for that.
@imbeacon I think this issue can be closed, the WiFiClientSecure works perfectly with the library and a few example do contain how to connect securely as well.