From 0d182820e8eaceacf4ee61a0775b443990708d9e Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 27 Aug 2020 16:25:52 +0200 Subject: [PATCH] expanduser for TLS files in MQTT listeners --- platypush/backend/mqtt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platypush/backend/mqtt.py b/platypush/backend/mqtt.py index e9bef18e4..11c689ed3 100644 --- a/platypush/backend/mqtt.py +++ b/platypush/backend/mqtt.py @@ -153,7 +153,7 @@ class MqttBackend(Backend): topics = listener.get('topics') username = listener.get('username') password = listener.get('password') - tls_cafile = listener.get('tls_cafile') + tls_cafile = os.path.abspath(os.path.expanduser(listener.get('tls_cafile'))) if not host or not topics: self.logger.warning('No host nor list of topics specified for ' + @@ -169,8 +169,8 @@ class MqttBackend(Backend): if tls_cafile: client.tls_set(ca_certs=tls_cafile, - certfile=listener.get('tls_certfile'), - keyfile=listener.get('tls_keyfile'), + certfile=os.path.abspath(os.path.expanduser(listener.get('tls_certfile'))), + keyfile=os.path.abspath(os.path.expanduser(listener.get('tls_keyfile'))), tls_version=MQTTPlugin.get_tls_version(listener.get('tls_version')), ciphers=listener.get('tls_ciphers'))