diff --git a/thingsboard_gateway/gateway/tb_client.py b/thingsboard_gateway/gateway/tb_client.py index 20abbb68..be2335b3 100644 --- a/thingsboard_gateway/gateway/tb_client.py +++ b/thingsboard_gateway/gateway/tb_client.py @@ -54,8 +54,10 @@ class TBClient(threading.Thread): tls_version=PROTOCOL_TLSv1_2, cert_reqs=CERT_REQUIRED, ciphers=None) - if self.__ca_cert is not None: + if (self.__ca_cert is not None and (self.__private_key is not None or self.__cert is not None)) or credentials.get("insecure", False): self.client._client.tls_insecure_set(False) + else: + self.client._client.tls_insecure_set(True) # if self.__tls and self.__ca_cert is None and self.__private_key is None and self.__cert is None: # pylint: disable=protected-access # Adding callbacks