Dauer: ~15 Minuten
Rolle: Security-Admin
Voraussetzung: Zertifikat (PFX oder PEM+KEY)
HTTPS für das Data Gateway aktivieren.
Option A: Let's Encrypt (kostenlos)
# Certbot installieren sudo apt install certbot # Zertifikat anfordern sudo certbot certonly --standalone -d gateway.example.com # Ergebnis: # /etc/letsencrypt/live/gateway.example.com/fullchain.pem # /etc/letsencrypt/live/gateway.example.com/privkey.pem
Option B: Selbstsigniert (nur Test!)
# Selbstsigniertes Zertifikat erstellen openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes \ -subj "/CN=gateway.example.com" # In PFX konvertieren openssl pkcs12 -export -out gateway.pfx -inkey key.pem -in cert.pem -passout pass:changeit
Option C: Interne CA
→ Siehe PQ Crypto: Zertifikat ausstellen
# Windows mkdir %GATEWAY_ROOT%\certs copy gateway.pfx %GATEWAY_ROOT%\certs\ # Linux sudo mkdir -p /opt/data-gateway/certs sudo cp cert.pem key.pem /opt/data-gateway/certs/ sudo chmod 600 /opt/data-gateway/certs/* sudo chown datagateway:datagateway /opt/data-gateway/certs/*
Mit PFX-Datei:
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://0.0.0.0:443",
"Certificate": {
"Path": "certs/gateway.pfx",
"Password": "changeit"
}
}
}
}
}
Mit PEM-Dateien:
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://0.0.0.0:443",
"Certificate": {
"Path": "certs/cert.pem",
"KeyPath": "certs/key.pem"
}
}
}
}
}
TLS-Version erzwingen:
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://0.0.0.0:443",
"Certificate": {
"Path": "certs/gateway.pfx",
"Password": "changeit"
},
"SslProtocols": ["Tls12", "Tls13"]
}
}
}
}
# Windows Restart-Service -Name "DataGateway" # Linux sudo systemctl restart data-gateway # Docker docker restart gateway
# Einfacher Test curl -k https://localhost/health # Mit Zertifikat-Prüfung curl https://gateway.example.com/health # TLS-Details anzeigen curl -v https://gateway.example.com/health 2>&1 | grep -E "SSL|TLS|subject|expire" # OpenSSL-Test openssl s_client -connect gateway.example.com:443 -servername gateway.example.com
Nur HTTPS erlauben:
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://0.0.0.0:443",
"Certificate": {
"Path": "certs/gateway.pfx",
"Password": "changeit"
}
}
}
}
}
Oder HTTP→HTTPS Redirect:
// Program.cs app.UseHttpsRedirection();
| # | Prüfpunkt | ✓ |
| — | ———– | — |
| 1 | Zertifikat gültig (nicht abgelaufen) | ☐ |
| 2 | Zertifikat für korrekten Hostnamen | ☐ |
| 3 | Private Key geschützt (chmod 600) | ☐ |
| 4 | HTTPS erreichbar | ☐ |
| 5 | TLS 1.2+ aktiv | ☐ |
| 6 | HTTP deaktiviert oder Redirect | ☐ |
| 7 | Firewall Port 443 offen | ☐ |
| Problem | Ursache | Lösung |
| ——— | ——— | ——– |
Unable to configure HTTPS | Falscher Pfad | Zertifikat-Pfad prüfen |
Password incorrect | Falsches PFX-Passwort | Passwort prüfen |
Certificate expired | Zertifikat abgelaufen | Neues Zertifikat |
SSL_ERROR_RX_RECORD_TOO_LONG | HTTP statt HTTPS | Port/Protocol prüfen |
NET::ERR_CERT_COMMON_NAME_INVALID | CN/SAN falsch | Zertifikat mit richtigem Namen |
« ← Sicherheit | → Zertifikat erneuern »
Wolfgang van der Stille @ EMSR DATA d.o.o. - Data Gateway Professional