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: if not version:
return None return None
if type(version) == type(ssl.PROTOCOL_TLS):
return version
if isinstance(version, str):
version = version.lower() version = version.lower()
if version == 'tls': if version == 'tls':
return ssl.PROTOCOL_TLS return ssl.PROTOCOL_TLS
if version == 'tlsv1': if version == 'tlsv1':