From 816492d3b234606dce8ee536ed1444f44dfb8b0d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 8 Feb 2021 01:44:26 +0100 Subject: [PATCH] Fixed MQTT over SSL default version spec in case the parameter is not a string --- platypush/plugins/mqtt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/mqtt.py b/platypush/plugins/mqtt.py index fa6e7889..a0c53c95 100644 --- a/platypush/plugins/mqtt.py +++ b/platypush/plugins/mqtt.py @@ -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':