MQTT over TLS/SSL #166
PerRieland
started this conversation in
General
Replies: 2 comments 1 reply
-
Very cool, thanks for posting this! There's another user aiming for something like this to use AWS. Can WiFiClientSecure fully replace regular WiFiClient? If so, I can find a way to make it into an optional element and put it into the official code at some point without much extra fuss. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Not sure if WiFiClientSecure can replace WiFiClient. It compile and upload without any problems. But when trying to use a NON SSL MQTT services, i failed. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Some cloud MQTT services will only work over TLS/SSL. It would be nice if FDRS had the option to connect encrypted.
I made some small changes to fdrs_gateway_mqtt.h so it could connect via SSL. Maybee not the right way to do it, but it can be used as a starter. It works with EMQX cloud.
Here is what i did in fdrs_gateway_mqtt.h:
1: Add #include <WiFiClientSecure.h>
2: Add a certificate
3: Changed WiFiClient espClient; to WiFiClientSecure espClient;
4: In void begin_mqtt(), set the certificate using espClient.setCACert(ca_cert);
fdrs_gateway_mqtt.zip
Beta Was this translation helpful? Give feedback.
All reactions