EspMQTTClient icon indicating copy to clipboard operation
EspMQTTClient copied to clipboard

Add support for SSL/TLS

Open KISSMonX opened this issue 5 years ago • 11 comments

Thank You。

KISSMonX avatar Nov 10 '19 10:11 KISSMonX

Unfortunatly, there is no SSL/TLS support yet with this lib. I will add that to the TODO list. Here is a PubSubClient issue discussing how you can achieve this with the PubSubClient lib : https://github.com/knolleary/pubsubclient/issues/462

plapointe6 avatar Nov 12 '19 13:11 plapointe6

Thank you for your reply, happy to look forward to the arrival of new features. 😊

KISSMonX avatar Nov 14 '19 02:11 KISSMonX

This feature would be very welcome! I hope it's on first line of your todo list... :)

steros76 avatar Nov 14 '19 19:11 steros76

Yes please! Yes please!

cstanke avatar Dec 04 '19 22:12 cstanke

Hi, Updating the library is in fact quite simple to make it work in TLS. It's probably quick and dirty, but works for me.

Change the include from #include <WiFiClient.h> to #include <WiFiClientSecure.h>

Then the declaration: WiFiClient mWifiClient; to WiFiClientSecure mWifiClient; and move it to public.

Then the library will use the secure library, and give you access from your code to the mWifiClient object where you'll be able to change settings and set properties such as:

client.mWifiClient.setFingerprint(fingerprint);   // <-- Set the SHA1 fingerprint to verify remote server
  // Alternative: client.mWifiClient.setInsecure();

Works for my mosquitto in mqtts.

nopap avatar Apr 06 '20 17:04 nopap

+1. Please add support for TLS (ideally server and client certs). Thanks.

codersaur avatar Apr 26 '20 20:04 codersaur

I would also really appreciate SSL support for HASS-YAAP :)

paviro avatar Jan 17 '21 10:01 paviro

+1. Please add support for TLS! Thanks!

cd334 avatar Dec 30 '22 21:12 cd334

+1 please

zouje avatar Jan 14 '23 04:01 zouje

There is no need in adding "+1" comments. That does not change anything. You could instead provide Pull Requests. ;)

EdJoPaTo avatar Jan 14 '23 11:01 EdJoPaTo

If someone takes time to implement this, I will take the time to review and test. However, I don't think I will implement this by myself. I work on this lib for free and I don't have as many free time as before. Also, as almost all of my home automation devices are now working on ZigBee, I don't use this lib as much as before. It became hard for me to test new functionnalities. Thank you for your comprehension.

plapointe6 avatar Jan 15 '23 21:01 plapointe6