Skip to content

Commit 974ae8e

Browse files
authored
Add initial doc to work with a self-signed cert (home-assistant#1150)
1 parent cf82b1b commit 974ae8e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
layout: page
3+
title: "Self-signed certificate for SSL/TLS"
4+
description: "Configure a self-signed certificate to use with Home Assistant"
5+
date: 2016-10-06 08:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: Infrastructure
11+
---
12+
13+
If your Home Assistant instance is only accessible from your local network you can still protect the communication between your browsers and the frontend with SSL/TLS. [Let's encrypt](blog/2015/12/13/setup-encryption-using-lets-encrypt/) will only work if you have a DNS entry and remote access is allowed. The solution is to use a self-signed certificate. As you most likely don't have a certification authority (CA) your browser will conplain about the security. If you have a CA then this will not be an issue.
14+
15+
To create locally a certificate you need the [OpenSSL](https://www.openssl.org/) command-line tool.
16+
17+
Change to your Home Assistant [configuration directory](/getting-started/configuration/) like `~/.homeassistant`. This will make it easier to backup your certificate and the key. Run the command shown below.
18+
19+
```bash
20+
$ openssl req -new -x509 -sha256 -newkey rsa:4096 -nodes -keyout privkey.pem -days 730 -out fullchain.pem
21+
```
22+
23+
For details about the parameters, please check the OpenSSL documentation. Provide the requested information during the generation process. At the end you will have two files called `privkey.pem` and `fullchain.pem`. The key and the certificate.
24+
25+
Update the `http:` entry in your `configuration.yaml` file and let it point to your created files.
26+
27+
```yaml
28+
http:
29+
api_password: YOUR_SECRET_PASSWORD
30+
ssl_certificate: /home/fab/.homeassistant/fullchain.pem
31+
ssl_key: /home/fab/.homeassistant/privkey.pem
32+
```
33+
34+
A tutorial "[Working with SSL Certificates, Private Keys and CSRs](https://www.digitalocean.com/community/tutorials/openssl-essentials-working-with-ssl-certificates-private-keys-and-csrs)" could give you some insight about special cases.

0 commit comments

Comments
 (0)