From 452533db177c0526cb7bf5d2dfd5ad9308fa077a 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 fa6e78892..a0c53c95c 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':