knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

Dedicated login() function #255

Open labfruits opened 7 years ago

labfruits commented 7 years ago

It would be useful to split the connect() logic to two functions, connect() and login().

connect() only opens a connection with the underlying Client object, login() performs the MQTT broker authentication and login process.

The background: I'm using a secure (TLS) client connection (WiFiClientSecure) and using it's certificate validation features. When I'm using this WiFiClientSecure object with your PubSubClient the connect() function opens a connection and directly performs a login on the MQTT broker. It's only possible to verify a secure TLS connection after the login and at this point the credentials are already transfered to the broker.

knolleary commented 7 years ago

Umm, how is this different to #254 that has now been edited/closed/ marked for deletion?

labfruits commented 7 years ago

I'm sorry. I used the wrong Github account for #254

knolleary commented 7 years ago

Fair enough. Just so you know, there is no 'delete' - it will sit in closed state.