Verwendung von selbstsignierten SSL-Zertifikaten
Obwohl selbstsignierte SSL-Zertifikate nicht von öffentlichen Zertifizierungsstellen (CA) vertrauenswürdig sind, sind sie dennoch in lokalen Entwicklungs- und Testumgebungen sehr nützlich. In diesem Artikel wird beschrieben, wie man mithilfe des OpenSSL-Tools von ServBay selbstsignierte ECC (Elliptic Curve Cryptography) SSL-Zertifikate erstellt und diese in ServBay konfiguriert. Wir werden servbay.demo
als Beispiel verwenden.
Schritt 1: Erstellung eines selbstsignierten ECC SSL-Zertifikats
Zunächst empfehlen wir die Verwendung von ECC-Zertifikaten, da diese eine höhere Sicherheit und bessere Leistung bieten. Die folgenden Schritte erläutern den Prozess:
Erstellung eines ECC-Privatschlüssels
Öffnen Sie das Terminal und führen Sie den folgenden Befehl aus, um einen ECC-Privatschlüssel zu generieren:
shopenssl ecparam -genkey -name prime256v1 -out servbay_demo.key
1Erstellung einer Zertifikatsignieranforderung (CSR)
Erstellen Sie mit dem generierten Privatschlüssel eine Zertifikatsignieranforderung:
shopenssl req -new -key servbay_demo.key -out servbay_demo.csr
1Dabei müssen Sie einige Informationen angeben. Hier ist ein Beispiel:
Country Name (2 letter code) [AU]:CN State or Province Name (full name) [Some-State]:Hong Kong Locality Name (eg, city) []:Kowloon Organization Name (eg, company) [Internet Widgits Pty Ltd]:ServBay Organizational Unit Name (eg, section) []:Development Common Name (e.g. server FQDN or YOUR name) []:servbay.demo Email Address []:[email protected]
1
2
3
4
5
6
7Erstellung eines selbstsignierten Zertifikats
Erstellen Sie mithilfe der CSR und des Privatschlüssels ein selbstsigniertes SSL-Zertifikat, das 365 Tage gültig ist:
shopenssl x509 -req -days 365 -in servbay_demo.csr -signkey servbay_demo.key -out servbay_demo.crt
1
Schritt 2: Verwendung des selbstsignierten SSL-Zertifikats in ServBay
Nachdem das selbstsignierte ECC SSL-Zertifikat erstellt wurde, müssen Sie es in ServBay konfigurieren. Legen Sie die erstellten Zertifikatsdateien im Verzeichnis /Applications/ServBay/ssl
ab, um sie einfach verwalten und nutzen zu können.
Verschieben der Zertifikatsdateien in das angegebene Verzeichnis
Verwenden Sie die folgenden Befehle, um die erstellten Zertifikatsdateien in das Verzeichnis
/Applications/ServBay/ssl
zu verschieben:shmv servbay_demo.key /Applications/ServBay/ssl/ mv servbay_demo.crt /Applications/ServBay/ssl/ mv servbay_demo.csr /Applications/ServBay/ssl/
1
2
3Öffnen des ServBay-Verwaltungspanels
Starten Sie die ServBay-Anwendung und öffnen Sie das Verwaltungspanel.
Hinzufügen eines Hosts
Wählen Sie im Verwaltungspanel die Option
Host
.Auswahl der Methode zur SSL-Zertifikatsausstellung
Während des Hinzufügens eines Hosts sehen Sie eine Option zur Auswahl der Methode zur SSL-Zertifikatsausstellung. Wählen Sie
Custom
.Angeben der Zertifikatsdateien
Geben Sie im Feld
Certificate Key File
die von Ihnen erstellte Schlüsseldatei und im FeldCertificate File
die Zertifikatsdatei an:- Zertifikatschlüsseldatei:
/Applications/ServBay/ssl/servbay_demo.key
- Zertifikatsdatei:
/Applications/ServBay/ssl/servbay_demo.crt
- Zertifikatschlüsseldatei:
Festlegen des Hostnamens und Domänennamens
Geben Sie im Feld
Domain Name
servbay.demo
ein.Abschluss des Hinzufügens eines Hosts
Folgen Sie den Anweisungen, um den Host hinzuzufügen. Ihr Host verwendet nun das selbstsignierte ECC SSL-Zertifikat.
Konfiguration überprüfen
Nach Abschluss der oben genannten Schritte können Sie den konfigurierten Host über den Browser aufrufen. Wenn der Browser anzeigt, dass das Zertifikat nicht vertrauenswürdig ist, ist dies normal, da selbstsignierte Zertifikate nicht von öffentlichen Zertifizierungsstellen anerkannt werden. Sie können das Zertifikat manuell vertrauen, um fortzufahren.
Zusammenfassung
Durch die obigen Schritte können Sie in ServBay selbstsignierte ECC SSL-Zertifikate erstellen und verwenden. Obwohl selbstsignierte Zertifikate nicht öffentlich vertrauenswürdig sind, bieten sie in der lokalen Entwicklung und im Testumfeld eine bequeme Lösung. Hoffentlich hilft Ihnen dieser Artikel, selbstsignierte SSL-Zertifikate erfolgreich zu konfigurieren und Ihre Entwicklungseffizienz zu verbessern.