... | ... | @@ -105,9 +105,14 @@ server { |
|
|
|
|
|
# TLS / Let's Encrypt
|
|
|
|
|
|
Wir nutzen `acme_tiny` für Let's Encrypt. Zertifikate sind in `/etc/ssl/letsencrypt`. Dort gibt es auch ein `renew.sh` Script zum automatischen Erneuern der Domains, was man in die `crontab` packen kann.
|
|
|
~~Wir nutzen `acme_tiny` für Let's Encrypt. Zertifikate sind in `/etc/ssl/letsencrypt`. Dort gibt es auch ein `renew.sh` Script zum automatischen Erneuern der Domains, was man in die `crontab` packen kann.~~
|
|
|
|
|
|
## Zertifikat für Domain erstellen.
|
|
|
## acme.sh
|
|
|
`acme.sh` macht das alles einfacher. alles zu `acme_tiny` ist obsolet.
|
|
|
|
|
|
|
|
|
|
|
|
## acme_tiny: Zertifikat für Domain erstellen.
|
|
|
|
|
|
[Ausführliche Dokumentation auf GitHub](https://github.com/drdaeman/acme-tiny/blob/f995b09b67498ef6fc538867eeeb63643cba5702/README.md)
|
|
|
|
... | ... | @@ -118,7 +123,7 @@ Wir nutzen `acme_tiny` für Let's Encrypt. Zertifikate sind in `/etc/ssl/letsenc |
|
|
# openssl genrsa 4096 > subdomain.bau-ha.us.key
|
|
|
```
|
|
|
|
|
|
## CSR Request erstellen
|
|
|
## acme_tiny: CSR Request erstellen
|
|
|
|
|
|
```
|
|
|
# openssl req -new -sha256 \
|
... | ... | @@ -140,6 +145,8 @@ Wir nutzen `acme_tiny` für Let's Encrypt. Zertifikate sind in `/etc/ssl/letsenc |
|
|
|
|
|
## Challenges Verzeichnis in nginx Konfiguration einbinden
|
|
|
|
|
|
muss laufen für acme.sh und acme_tiny
|
|
|
|
|
|
```
|
|
|
# /etc/nginx/sites-available/subdomain.bau-ha.us
|
|
|
server {
|
... | ... | @@ -151,13 +158,14 @@ server { |
|
|
try_files $uri =404;
|
|
|
}
|
|
|
|
|
|
// optional redirect https-only
|
|
|
location / {
|
|
|
return 301 https://$host$request_uri;
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Zertifikat von Let's Encrypt unterschreiben lassen.
|
|
|
## acme_tiny: Zertifikat von Let's Encrypt unterschreiben lassen.
|
|
|
|
|
|
### Per Script
|
|
|
|
... | ... | @@ -189,8 +197,15 @@ server { |
|
|
ssl on;
|
|
|
|
|
|
# ssl magic
|
|
|
# acme_tiny
|
|
|
ssl_certificate /etc/ssl/letsencrypt/subdomain.bau-ha.us.chained.pem;
|
|
|
ssl_certificate_key /etc/ssl/letsencrypt/subdomain.bau-ha.us.key;
|
|
|
# acme.sh
|
|
|
ssl_certificate /root/.acme.sh/subdomain.bau-ha.us/fullchain.cer;
|
|
|
ssl_certificate_key /root/.acme.sh/subdomain.bau-ha.us/subdomain.bau-ha.us.key;
|
|
|
ssl_trusted_certificate /root/.acme.sh/subdomain.bau-ha.us/ca.cer;
|
|
|
|
|
|
|
|
|
ssl_stapling on;
|
|
|
ssl_stapling_verify on;
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
... | ... | |