From 5bf7d39ec01b8944c42ba2896a8bf5cb7e37e07c Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 7 Feb 2022 16:28:01 +0100 Subject: [PATCH] fix --- opcua2mqtt/MqttBase.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opcua2mqtt/MqttBase.py b/opcua2mqtt/MqttBase.py index 6033846..8649b68 100644 --- a/opcua2mqtt/MqttBase.py +++ b/opcua2mqtt/MqttBase.py @@ -44,6 +44,14 @@ class AbstractMqttPublisher(threading.Thread): tls_version=ssl.PROTOCOL_TLSv1_2, ciphers=None # this does not mean "no cipher" but it means "default ciphers" ) + elif ("ca" in self.config): + self.client.tls_set( + keyfile=self.config["key"], + cert_reqs=ssl.CERT_REQUIRED, + tls_version=ssl.PROTOCOL_TLSv1_2, + ciphers=None # this does not mean "no cipher" but it means "default ciphers" + ) + self.client.connect(self.config["broker"], int(self.config["port"])) self.client.loop_start()