mlesniew / PicoMQTT

ESP MQTT client and broker library
GNU Lesser General Public License v3.0
219 stars 25 forks source link

Implementation for TLS #8

Closed dasflaigsi closed 11 months ago

dasflaigsi commented 1 year ago

Is there a plan for implementing TLS in near future?

mlesniew commented 1 year ago

So far I was not planning to implement TLS support, but I think it could be implemented relatively easily.

Internally, the MQTT broker classes use the WiFiClient class as an interface for all communication. The ESP8266 and ESP32 cores also have a WiFiClientSecure class implementation, which has the same interface with additional TLS functionality.

My first thought on how to implement this would be by using C++ templates. This would potentially allow us to not only use TLS, but perhaps also other types of connections, e.g. Ethernet.

If you would like to give it a try, I'm happy to review your PR and help where I can.