Instead of using the MQTT_TLS_PORT value as indication whether TLS should be used, this change introduces private field that is set based on the MQTT()is_ssl argument.
The downside of this approach is that if someone specifies port=1883 explicitly without setting is_ssl to False, the port will be treated as TLS port since the is_ssl is True by default and OSError("Failed SSL handshake") will be thrown, unless the broker is configured to accept TLS on that port. I have not made my mind yet whether to special case it and force to insecure so leaving it open for the reviewers.
Instead of using the
MQTT_TLS_PORT
value as indication whether TLS should be used, this change introduces private field that is set based on theMQTT()
is_ssl
argument.The downside of this approach is that if someone specifies
port=1883
explicitly without settingis_ssl
to False, the port will be treated as TLS port since theis_ssl
is True by default andOSError("Failed SSL handshake")
will be thrown, unless the broker is configured to accept TLS on that port. I have not made my mind yet whether to special case it and force to insecure so leaving it open for the reviewers.