AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
202 stars 71 forks source link

TLS support #74

Closed dbrgn closed 6 years ago

dbrgn commented 6 years ago

Hi, here are some ideas worth considering before the async release (#72) 🙂

From the code it looks like you're currently using the openssl crate directly to implement TLS support.

My suggestion would be to switch to native-tls if possible. It uses the native TLS stack on every platform, so it's easy to compile rumqtt based programs on Windows, mac OS or mobile platforms like iOS. Compiling openssl on mac OS is merely an annoyance, but for iOS it's a pain. Switching from openssl to native_tls shouldn't be a big deal, the code is structured similarly.

Furthermore, right now I need to pass in a CA certificate as a path string to a PEM file. In the websocket crate, the connect_secure method takes a TlsConnector as argument. This provides much more flexibility, since the certificates can now be read from a wide range of sources and formats. Maybe that would also work in rumqtt?

tekjar commented 6 years ago

v3 uses rustls by default. Please reopen this if it doesn't