Fixed MQTT over SSL default version spec in case the parameter is not a string

This commit is contained in:
Fabio Manganiello 2021-02-08 01:44:26 +01:00
parent 314c01ef97
commit 452533db17

View file

@ -82,7 +82,12 @@ class MqttPlugin(Plugin):
if not version:
return None
version = version.lower()
if type(version) == type(ssl.PROTOCOL_TLS):
return version
if isinstance(version, str):
version = version.lower()
if version == 'tls':
return ssl.PROTOCOL_TLS
if version == 'tlsv1':