Downloader integration - self-signed certs

I’m trying to download an image from a local https service I have running in a docker container. The service is using a self-signed certificate. When I try to call the downloader.download_file service, I get the following in my HA logs:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 362, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 397, in ssl_wrap_socket
    return context.wrap_socket(sock)
  File "/usr/local/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/local/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/local/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1123)

Is there any way around this?

1 Like

I have the same problem … I want to downwload some snapshots from my camera but it throws the same error because of the self signed certificate … and when I try to use wget as a shell_command … it seems the version of the wget from that enviroment is totally different from the terminal/host version … and iti refuses -password option or if I try to include it inside the url … but when I go to the terminal and paste the same shell_command it works just fine =/ #frustrating

1 Like

Same issue here, I also need to get a snapshot directly from my cam because the integration with native camera.snapshot service has a delay.
I obviously don’t configure a certificate on my cameras interface, I’m just using the HTTPS to have a minimal security even if it’s local.