Lets Encrypt

Hello Everybody,

I somebody help me with Let’s encrypt.
I have used the instruction on https://home-assistant.io/blog/2015/12/13/setup-encryption-using-lets-encrypt/
And http://www.bruhautomation.com/single-post/2016/07/17/Part-3-Encrypting-Home-Assistant-and-External-Access

I have setup Duckdns.
This is working perfect and redirect to my external ip adress so i can acces home assistant.

Now i want to config SSL with Let’s encrypt. I have intallated home assitant in a Virtualenv to follow inscruction on https://home-assistant.io/getting-started/installation-virtualenv/

The problem now is, if i acces my https://mydomain.duckdns.org i get the error:mydomain.duckdns.org has refused the connection.

Yes, i have forward port 443 to internal 8123.

Where it is going wrong? Is it a problem i use homeassitant on Virtualnv? If it is Yes, what i have to do to make home assistant running on SSL?

Thanks for the help!

You have made a spelling mistake at the headline. Encryt --> Encrypt

2 Likes

thx, i have changed it(Y)

Nice catch!

Following…

have you added the SSL cert locations to your config file?

Another possible configuration would be to setup a apache/nginx front end and configure a reverse proxy and keep the ssl configuration separate from the HASS config.

This would give you more options for authentication as well, allowing say ldap or mod_auth_openidc for SSO authentication.

Yes, i have

Finally, with a lot of trying it is working! :grinning:

I have this information in a include secret file, and then by my, it is not working,
Now is have the http: information in the configuration.yaml file and now it works.

Is it not possible if you use https to put the http login information in a include secret.yaml?

Thanks for the information en helping everyone.

…so I followed the instructions as well, but I am getting the following error:

16-12-20 10:50:16 homeassistant.bootstrap: Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/etc/letsencrypt/live/sitename.duckdns.org/fullchain.pem’
not a file for dictionary value @ data[‘http’][‘ssl_key’]. Got ‘/etc/letsencrypt/live/sitename.duckdns.org/privkey.pem’. (See /home/hass/.homeassistant/configuration.yaml:22).

Any ideas? Running version 0.33.3

Can you give display this part of your code? Without password :slight_smile:

@rmdejonge I presume you mean from the config file?

http:
api_password: password
ssl_certificate: /etc/letsencrypt/live/sitename.duckdns.org/fullchain.pem
ssl_key: /etc/letsencrypt/live/sitename.duckdns.org/privkey.pem

For sure:
1.In your code you have display it like this, not in one row?
2. And you are sure that the files are in de location as displayed?
3. You must change the link to your website/duckdns name like:
thisismysite.duckdns,org/privley.pem ect…

http:
   api_password: password
   ssl_certificate: /etc/letsencrypt/live/sitename.duckdns.org/fullchain.pem 
   ssl_key: /etc/letsencrypt/live/sitename.duckdns.org/privkey.pem

thanks @rmdejonge

  1. Yes they are indented 2 spaces
  2. files are there - i just double checked
  3. yes the name is a FQDN

funny thing is, HA won’t start with the 2 SSL config lines in there. Once they are commented out, the site is active and the password is enforced.

Try adding single quotes around your ssl paths. Not sure if it matters or not but that’s how i have mine and they work.

ssl_certificate: '/etc/letsencrypt/live/sitename.duckdns.org/fullchain.pem'
ssl_key: '/etc/letsencrypt/live/sitename.duckdns.org/privkey.pem'

My other suggestion is to use Notepad++ to edit your yaml files and set it up to show white space and tabs.

View > Show Symbol > Show white space and tabs

When I was starting out a lot of my issues ended up being related to spacing and tabs, especially if copying and pasting from examples.

thanks @Mike_D but that didn’t work either - although I did verify that there is no white-space/tab issue with Notepad++

could this be caused by a bad SSL?

Hi @pjo I have exactly the same issue. Have you been able to resolve it?

Those of you that have Let’s Encrypt working in a virtualenv, where have you installed certbot? Did you do it from your admin account (I’m running Ubuntu 16.04) or after becoming the virtualenv user (ie after doing step 3 of the virtualenv installation instructions) or after becoming and activating the virtualenv (steps 3 and 5 of the installation)?
I am presuming the latter, so that the same account is running home assistant and managing the certicates, but can’t even get the mkdir certbot command to work because of permissions issues.
I recall seeing somewhere that we may need to make the homeassistant user a sudoer, but doesn’t that negate the benefits of running a virtualenv?

hallo!

anybody tried to setup ssl with the „let‘s encrypt“ add-on?

addon does not start up without ssl in configuration and hassio does not start up WITH ssl path in config!

where do i get the ssl files to put them in the folders manually?

thx in advance

How about using the DuckDNS add-on? it includes Lets Encrypt by default.

This one:
image