I am using ThingsBoard gateway to connect to ThingsBoard from an IoT device; I want to use a TLS certificate to secure the connection.
I provide the full chain for the TLS certificate to the YAML configuration file, but the thingsboard-gateway service gives an error:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1076)
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/thingsboard_gateway/gateway/tb_client.py", line 173, in run
min_reconnect_delay=self.__min_reconnect_delay)
File "/home/root/.local/lib/python3.7/site-packages/tb_device_mqtt.py", line 402, in connect
self._client.connect(self.__host, self.__port, keepalive=keepalive)
File "/home/root/.local/lib/python3.7/site-packages/paho/mqtt/client.py", line 915, in connect
return self.reconnect()
File "/home/root/.local/lib/python3.7/site-packages/paho/mqtt/client.py", line 1086, in reconnect
sock.do_handshake()
File "/usr/lib/python3.7/ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get issuer certificate (_ssl.c:1076)
This seems to suggest that _ssl.c fails to verify the full chain. I guess that it does not recognize the CA; the CA, anyway, is Let's Encrypt.
How can I solve this problem?