1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

remove redundant tls_insecure_set() call

This commit is contained in:
igloodan
2021-10-22 12:21:26 +00:00
parent 1dca7a2654
commit f4063baa8b

View File

@@ -54,11 +54,8 @@ class TBClient(threading.Thread):
tls_version=PROTOCOL_TLSv1_2, tls_version=PROTOCOL_TLSv1_2,
cert_reqs=CERT_REQUIRED, cert_reqs=CERT_REQUIRED,
ciphers=None) ciphers=None)
if (self.__ca_cert is not None and (self.__private_key is not None or self.__cert is not None)):
self.client._client.tls_insecure_set(False)
if credentials.get("insecure", False): if credentials.get("insecure", False):
self.client._client.tls_insecure_set(True) 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 # pylint: disable=protected-access
# Adding callbacks # Adding callbacks
self.client._client._on_connect = self._on_connect self.client._client._on_connect = self._on_connect