Open labfruits opened 7 years ago
Umm, how is this different to #254 that has now been edited/closed/ marked for deletion?
I'm sorry. I used the wrong Github account for #254
Fair enough. Just so you know, there is no 'delete' - it will sit in closed state.
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.