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 0bddbb0bca
commit 816492d3b2
1 changed files with 6 additions and 1 deletions

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':