ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
267 stars 34 forks source link

Unable to setup TLS connection to external docker server - [Errno 2] No such file or directory #95

Closed adub08 closed 2 years ago

adub08 commented 2 years ago

Hi Great HACS addon, been using it for a while running non-encrypted socket connection to docker but recently i changed that. Since then I have been having issues getting it to connect. I think the issue is the with the certpath. I've set this as certpath: /config/custom_components/monitor_docker/ but also tried certpath: /config/custom_components/monitor_docker/docker.pem Is this cert path looking for the full path to cert file, or is it just looking for folder path with both the server docker cert and the ca.pem cert?

Any help would be greatly appreciated

Addon Error log:

Traceback (most recent call last): File "/config/custom_components/monitor_docker/helpers.py", line 162, in init self._api = aiodocker.Docker(url=url) File "/usr/local/lib/python3.9/site-packages/aiodocker/docker.py", line 113, in init ssl_context = self._docker_machine_ssl_context() File "/usr/local/lib/python3.9/site-packages/aiodocker/docker.py", line 374, in _docker_machine_ssl_context context.load_cert_chain( FileNotFoundError: [Errno 2] No such file or directory

ualex73 commented 2 years ago

The certificate names should be: cert.pem key.pem

adub08 commented 2 years ago

Thanks! That helped, I could not find it documented anyway but it turned out the ca cert for docker needed to list both the root level cert and intermediate cert.