Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
de:server:services:ssl [2023/01/06 19:26] – [Installation des Root-Zertifikats auf allen Geräten] fixed link to header dan | de:server:services:ssl [2024/05/11 22:09] (current) – [Arch Linux] deleted sudo to be consistent with other tutorials dan | ||
---|---|---|---|
Line 5: | Line 5: | ||
Dieses Tutorial basiert auf der Domain '' | Dieses Tutorial basiert auf der Domain '' | ||
- | Es ist auch wichtig, dass die Domain-Adresse von deinem Router umgeleitet wird. Dies kann auch in der Datei ''/ | + | Es ist auch wichtig, dass die Domain-Adresse von deinem Router umgeleitet wird oder mit [[/ |
< | < | ||
Line 12: | Line 12: | ||
- | ===== Generierung des privaten Schlüssels und des Root Zertifikats | + | ===== mkcert |
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
+ | ==== Packete | ||
< | < | ||
- | openssl genrsa | + | pacman |
</ | </ | ||
+ | |||
+ | |||
+ | ==== Root-Zertifikat erstellen ==== | ||
< | < | ||
- | openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem | + | mkcert |
</ | </ | ||
- | Ändere die folgenden Informationen nach deinen Wünschen. Die Infos werden z.B. angezeigt, wenn du das Zertifikat über deinen Browser ansiehst. | + | |
+ | ==== Zertifikate für Ihre Domains erstellen ==== | ||
< | < | ||
- | Country Name (2 letter code) [AU]: | + | mkcert nextcloud.home |
- | State or Province Name (full name) [Some-State]: | + | |
- | Locality Name (eg, city) []: | + | |
- | Organization Name (eg, company) [Internet Widgits Pty Ltd]: | + | |
- | Organizational Unit Name (eg, section) []: | + | |
- | Common Name (e.g. server FQDN or YOUR name) []: | + | |
- | Email Address []: | + | |
</ | </ | ||
- | ===== Installation des Root-Zertifikats auf allen Geräten | + | ===== Manuell |
- | Du musst auf jedem Gerät eine '' | ||
+ | ==== Generierung des privaten Schlüssels und des Root Zertifikats ==== | ||
- | ==== Arch Linux ==== | + | < |
+ | openssl genrsa -des3 -out rootCA.key 2048 | ||
+ | </ | ||
< | < | ||
- | sudo trust anchor | + | openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1825 -out rootCA.pem |
</ | </ | ||
+ | Ändere die folgenden Informationen nach deinen Wünschen. Die Infos werden z.B. angezeigt, wenn du das Zertifikat über deinen Browser ansiehst. | ||
- | ==== Android ==== | + | < |
- | + | Country Name (2 letter code) [AU]: | |
- | '' | + | State or Province Name (full name) [Some-State]: |
- | + | Locality Name (eg, city) []: | |
- | Check under: | + | Organization Name (eg, company) [Internet Widgits Pty Ltd]: |
- | + | Organizational Unit Name (eg, section) []: | |
- | '' | + | Common Name (e.g. server FQDN or YOUR name) []: |
+ | Email Address []: | ||
+ | </ | ||
- | ===== Erstellung von CA-signierten Zertifikaten für deine Domains | + | ==== Erstellung von CA-signierten Zertifikaten für deine Domains ==== |
< | < | ||
- | openssl genrsa -out domain.home.key 2048 | + | openssl genrsa -out nextcloud.home-key.pem 2048 |
</ | </ | ||
< | < | ||
- | openssl req -new -key DOMAIN.home.key -out DOMAIN.home.csr | + | openssl req -new -key nextcloud.home-key.pem -out nextcloud.home.pem |
</ | </ | ||
< | < | ||
- | nano DOMAIN.home.ext | + | nano nextcloud.home.ext |
</ | </ | ||
Line 76: | Line 85: | ||
[alt_names] | [alt_names] | ||
- | DNS.1 = DOMAIN.home | + | DNS.1 = nextcloud.home |
</ | </ | ||
- | ==== Script | + | === Script === |
Erstelle die Datei in '' | Erstelle die Datei in '' | ||
Line 95: | Line 104: | ||
DOMAIN=$1 | DOMAIN=$1 | ||
- | openssl genrsa -out $DOMAIN.key 2048 | + | openssl genrsa -out $DOMAIN-key.pem 2048 |
- | openssl req -new -key $DOMAIN.key -out $DOMAIN.csr | + | openssl req -new -key $DOMAIN-key.pem -out $DOMAIN.pem |
cat > $DOMAIN.ext << EOF | cat > $DOMAIN.ext << EOF | ||
Line 107: | Line 116: | ||
EOF | EOF | ||
- | openssl x509 -req -in $DOMAIN.csr -CA myCA.pem -CAkey | + | openssl x509 -req -in $DOMAIN.pem -CA rootCA.pem -CAkey |
-out $DOMAIN.crt -days 825 -sha256 -extfile $DOMAIN.ext | -out $DOMAIN.crt -days 825 -sha256 -extfile $DOMAIN.ext | ||
</ | </ | ||
Line 113: | Line 122: | ||
< | < | ||
chmod +x ssl.sh | chmod +x ssl.sh | ||
- | ./ | + | ./ |
</ | </ | ||
+ | |||
+ | ===== Installation des Root-Zertifikats auf allen Geräten ===== | ||
+ | |||
+ | Du musst auf jedem Gerät eine '' | ||
+ | |||
+ | Wenn du [[#mkcert]] benutzt hast, führe einfach den Befehl '' | ||
+ | |||
+ | |||
+ | ==== Arch Linux ==== | ||
+ | |||
+ | < | ||
+ | trust anchor --store rootCA.pem | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Android ==== | ||
+ | |||
+ | |||
+ | === User trusted credentials === | ||
+ | |||
+ | '' | ||
+ | |||
+ | Check unter: | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | === System trusted credentials === | ||
+ | |||
+ | Wenn "User trusted credentials" | ||
+ | |||
+ | < | ||
+ | hashed_name=`openssl x509 -inform PEM -subject_hash_old -in rootCA.pem | head -1` && cp rootCA.pem $hashed_name.0 | ||
+ | ls $hashed_name.0 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | adb root | ||
+ | adb shell mount -o rw,remount / | ||
+ | adb push $hashed_name.0 / | ||
+ | adb shell chmod 644 / | ||
+ | adb shell chown root:root / | ||
+ | adb shell reboot | ||
+ | </ | ||
+ | |||
+ | Du kannst auch die Magisk-Module [[https:// | ||
+ | |||
+ | |||
+ | === CA-Zertifikate von Drittanbietern für Firefox verwenden === | ||
+ | |||
+ | Du kannst auch die Option '' | ||
+ | |||
+ | - Öffne deinen Browser, scrolle nach unten und klicke auf Über firefox/ | ||
+ | - Klick mehrmals auf das Logo und gehe zurück | ||
+ | - Klicke auf Geheime Einstellungen und aktiviere '' | ||
===== Nginx ===== | ===== Nginx ===== | ||
Line 126: | Line 190: | ||
< | < | ||
nano / | nano / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ssl_protocols TLSv1.3; | ||
+ | ssl_prefer_server_ciphers on; | ||
+ | ssl_ciphers " | ||
+ | ssl_ecdh_curve secp384r1; | ||
+ | ssl_session_cache shared: | ||
</ | </ | ||
Line 146: | Line 218: | ||
server_name nextcloud.home; | server_name nextcloud.home; | ||
- | ssl_certificate / | + | ssl_certificate / |
- | ssl_certificate_key / | + | ssl_certificate_key / |
include conf.d/ | include conf.d/ | ||
| |