HA 0.65.0 Docker install can't read OpenSSL cert/key

I’ve just switched from a virtualenv HA install to a Docker install on Lubuntu 16.10. I copied my config folder across, and HA will not start in Docker (it was fine in the virtualenv). I regenerated a certificate.pem and privkey.pem (using OpenSSL) into my HA config folder (/home/myuser/homeassistant). That folder has read-write permissions for all users, but I get this when I check my config:

Failed config
  http: 
    - Invalid config for [http]: not a file for dictionary value @ data['http']['ssl_certificate']. Got '/home/myuser/homeassistant/certificate.pem'
not a file for dictionary value @ data['http']['ssl_key']. Got '/home/myuser/homeassistant/privkey.pem'

My http config entry looks like this:

http:
  api_password: mypassword
  ssl_certificate: /home/myuser/homeassistant/certificate.pem
  ssl_key: /home/myuser/homeassistant/privkey.pem

Any idea why the Docker install doesn’t like the SSL cert/key?

try /local/myuser… depending on how you defined your config folder in your docker run command.

i couldn’t get mine to read until i added the /local/…to the beginning of the cert location.

i’ve since given up on docker at least for now and just running in a virtual environment on a debian install. way less confusing…

Thanks. I’ve since discovered (thanks to advice elsewhere here) that using the -v parameter on my Docker run command (when I created the HA Docker container) enabled me to map a folder to the Docker container. So:

docker run -v ~/homeassistant:/config

mapped my ~/homeassistant folder to a folder called /config in the HA Docker container. I then changed my config to refer to /config/certificate.pem and /config/privkey.pem and it all started working.

1 Like

Hi,
i have the same issue with cert/key on my docker on QNAP NAS (i followed the official HA Guide):

Failed config
http:
- Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/share/Container/HomeAssistant/certificate.pem’
not a file for dictionary value @ data[‘http’][‘ssl_key’]. Got ‘/share/Container/HomeAssistant/privkey.pem’. (See /config/configuration.yaml, line 26). Please check the docs at https://home-assistant.io/components/http/

My http settings :

http:
api_password: MYPASS
server_port: 8123
base_url: MYDNS.com:8123
ssl_certificate: /share/Container/HomeAssistant/certificate.pem
ssl_key: /share/Container/HomeAssistant/privkey.pem

solved with:
ssl_certificate: /config/certificate.pem
ssl_key: /config/privkey.pem