Komplexität: Mittel
Dauer: 1-2 Stunden Setup
Voraussetzung: DNS/HTTP Challenge-Zugang
Integration des ACME-Protokolls (RFC 8555) für automatische Zertifikatserneuerung mit Post-Quantum-Unterstützung.
# Debian/Ubuntu apt update && apt install certbot python3-certbot-nginx # RHEL/CentOS dnf install certbot python3-certbot-nginx # Mit DNS-Plugin (Cloudflare) apt install python3-certbot-dns-cloudflare
Für öffentlich erreichbare Webserver:
# Nginx certbot --nginx -d example.com -d www.example.com # Apache certbot --apache -d example.com -d www.example.com # Standalone (Port 80 frei) certbot certonly --standalone -d example.com # Webroot (existierender Server) certbot certonly --webroot -w /var/www/html -d example.com
Auto-Renewal Cron:
# Automatisch bei certbot-Installation aktiviert # Manuell prüfen: systemctl status certbot.timer # Manueller Test certbot renew --dry-run
Für interne Server oder Wildcards:
# /etc/letsencrypt/cloudflare.ini dns_cloudflare_api_token = YOUR_API_TOKEN
chmod 600 /etc/letsencrypt/cloudflare.ini certbot certonly \ --dns-cloudflare \ --dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \ -d example.com \ -d "*.example.com"
# AWS Credentials in ~/.aws/credentials certbot certonly \ --dns-route53 \ -d example.com \ -d "*.example.com"
# Mit certbot-dns-azure Plugin pip install certbot-dns-azure certbot certonly \ --authenticator dns-azure \ --dns-azure-credentials /etc/letsencrypt/azure.ini \ -d example.com
Hooks werden nach erfolgreicher Erneuerung ausgeführt.
# /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh #!/bin/bash systemctl reload nginx echo "$(date): Nginx reloaded" >> /var/log/certbot-deploy.log
chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
# /etc/letsencrypt/renewal-hooks/deploy/reload-apache.sh #!/bin/bash systemctl reload apache2
# /etc/letsencrypt/renewal-hooks/deploy/docker-reload.sh #!/bin/bash docker exec nginx nginx -s reload # oder docker-compose restart nginx
# /etc/letsencrypt/renewal-hooks/post/notify.sh #!/bin/bash DOMAINS=$(echo $RENEWED_DOMAINS | tr ' ' '\n') echo "Erneuert: $DOMAINS" | mail -s "Zertifikat erneuert" admin@example.com
Für interne PKI mit ACME-Unterstützung:
# Step-CA installieren wget https://github.com/smallstep/certificates/releases/download/v0.25.0/step-ca_0.25.0_amd64.deb dpkg -i step-ca_0.25.0_amd64.deb # CA initialisieren step ca init --name="Internal CA" --dns=ca.internal.example.com --address=:443
ACME Provisioner hinzufügen:
step ca provisioner add acme --type ACME
Certbot mit privater CA:
certbot certonly \
--server https://ca.internal.example.com/acme/acme/directory \
--standalone \
-d internal-server.example.com
Stand 2024: ACME-Protokoll und Let's Encrypt unterstützen noch keine PQ-Signaturen.
Hybrid-Strategie:
# 1. ACME-Zertifikat für TLS-Handshake (ECDSA) certbot certonly --nginx -d example.com # 2. Zusätzliches PQ-Zertifikat für Hybrid-Modus # (parallel via eigene PKI mit WvdS)
// C#: Hybrid-Zertifikat parallel erstellen using var ecdsa = ECDsa.Create(ECCurve.NamedCurves.nistP384); var request = new CertificateRequest( "CN=example.com", ecdsa, HashAlgorithmName.SHA384); // Mit PQ-Extension für zukunftssichere Clients var cert = request.CreateSelfSigned( DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddDays(90), CryptoMode.Hybrid);
# Certbot Logs tail -f /var/log/letsencrypt/letsencrypt.log # Zertifikat-Ablauf prüfen certbot certificates # Prometheus Exporter (cert-exporter) # Überwacht alle Zertifikate auf Ablauf
| Problem | Ursache | Lösung |
| ——— | ——— | ——– |
Challenge failed | Port 80/443 blockiert | Firewall prüfen |
DNS propagation | DNS-Cache | Warten (bis 60 Min) oder TTL reduzieren |
Rate limit exceeded | Zu viele Requests | Staging-Server nutzen |
unauthorized | Domain-Validierung fehlgeschlagen | DNS-Einträge prüfen |
# Staging-Server für Tests (keine Rate-Limits) certbot certonly --staging --nginx -d test.example.com # Debug-Modus certbot certonly --nginx -d example.com --debug
| # | Prüfpunkt | ✓ |
| — | ———– | — |
| 1 | DNS/HTTP Challenge konfiguriert | ☐ |
| 2 | Certbot installiert und getestet | ☐ |
| 3 | Auto-Renewal aktiviert (Timer) | ☐ |
| 4 | Deploy-Hook konfiguriert | ☐ |
| 5 | Monitoring eingerichtet | ☐ |
| 6 | Benachrichtigung bei Fehler | ☐ |
« ← Automatisierung | → CI/CD Code-Signing »
Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional