Securing Your Home Assistant With LetsEncrypt SSL
Prepare Your Home Assistant For SSL
Edit your configuration.yaml and add ssl_certificate and ssl_key under http:. Replace the text your_domain with your unique domain name.Save the configuration, and restart Home Assistant.
http:
# Secrets are defined in the file secrets.yaml
api_password: !secret http_password
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
ssl_certificate: /etc/letsencrypt/live/your_domain.duckdns.org/fullchain.pem
ssl_key: /etc/letsencrypt/live/your_domain.duckdns.org/privkey.pem
Test Your Setup
It’s now time to test your setup. Fire up your browser - and enter your domain in the address bar now. Because your are using SSL now, make sure your URL begins with https://. As an example:
https://your_domain.duckdns.org:8123/
Check for the lock symbol before your domain, it should have a symbol of a lock, with no lines or cross over the lock.
Different browsers have different notations to represent encryption. Most browsers will display a padlock, and it’s usually green in colour. Your website is now protected if you see something similar to the above.
And that’s it. Now that your Home Assistant is protected by SSL, this means:
- Your API password is encrypted, safe from prying eyes
- You can connect your Home Assistant environment to Google Assistant. We’d talk more about this in a future article.