Was ist OpenSSL? Wie funktioniert OpenSSL?

Eine ordnungsgemäße SSL-Implementierung ist entscheidend für die Sicherheit und den Erfolg einer Website. Und da so viele Web-Besitzer sich zum ersten Mal mit SSL befassen, ist es wichtig, sie mit allen notwendigen Tools und Hilfsmitteln auszustatten. Ein solches Werkzeug ist OpenSSL. Was also ist OpenSSL und warum ist es so wichtig?

The following guide covers every aspect of this useful utility, including how to use OpenSSL and the various OpenSSL commands for easy and efficient SSL management.


Inhaltsübersicht

  1. What Is OpenSSL?
  2. What Is OpenSSL Used For?
  3. How to Use OpenSSL
  4. Common OpenSSL Commands

Was ist OpenSSL?

OpenSSL is an all-around cryptography library that offers an open-source application of the TLS protocol. It allows users to perform various SSL-related tasks, including CSR (Certificate Signing Request) generation, private keys generation and SSL certificate installation.


What Is OpenSSL Used For?

OpenSSL is an open-source command line tool that is commonly used to generate CSRs and private keys, install the SSL files on your server, merge files, convert your certificate into various SSL formats, verify certificate information and troubleshoot any potential issues.

To install an SSL certificate on your website, you must follow a few mandatory steps, which are the same for any server or email client. OpenSSL is especially handy when you don’t have a web control panel or want to streamline the whole process.

Since not all servers provide web user interfaces for SSL management, on some platforms OpenSSL is the only solution to import and configure your certificate.


How to Use OpenSSL

Bei OpenSSL dreht sich alles um die Befehlszeilen. Sie müssen lediglich ein paar gängige OpenSSL-Befehle lernen, und mit jedem neuen Zertifikat wird der Konfigurationsprozess schneller und einfacher.

First released in 1998, OpenSSL is available for Linux, Windows, macOS, and BSD systems. Most of the Linux distributions come with OpenSSL pre-compiled.

Wie prüft man, ob OpenSSL auf Linux installiert ist?

To check if OpenSSL is installed on your Linux system, use the commands below.

Für GNU/Linux-Distributionen, die rpm-Pakete verwenden:

rpm -qa | grep -i openssl

Für GNU/Linux-Distributionen, die deb-Pakete verwenden:

dpkg -l | grep -i openssl

Für Arch Linux verwenden:

pacman -Q openssl


Wie verwendet man OpenSSL unter Windows?

If you’re on a Windows system, you can download OpenSSL from here.

The default installation will create a directory for the program on your C drive – C:\OpenSSL-Win32

To run the program, go to the C:\OpenSSL-Win32\bin\ directory and double-click the openssl.exe file. A text window will open with an OpenSSL> prompt.

Enter the OpenSSL commands you need at this prompt. The files you generate will be in this same directory. OpenSSL commands for Windows are identical to those used on Linux servers.


Common OpenSSL Commands

Im Folgenden haben wir ein paar gängige OpenSSL-Befehle für normale Benutzer zusammengestellt. Sie können diese jederzeit verwenden, wenn Sie Ihre Zertifikate erstellen oder verwalten möchten.

Check the OpenSSL Version

It’s imperative to know what OpenSSL version you have as it determines which cryptographic algorithms and protocols you can use. You can check your OpenSSL version by running the following command:

openssl-Version -a


Generate a CSR with OpenSSL

You can use OpenSSL to create your CSR (Certificate Signing Request) code. Run the following command to generate the CSR:

openssl req -new -key ihredomain.key -out ihredomain.csr

Sie können Ihre Informationen auch in der Befehlszeile selbst mit Hilfe des Schalters -subj übermitteln.

Mit diesem Befehl werden die Frageaufforderungen deaktiviert:

openssl req -new -key yourdomain.key -out yourdomain.csr -subj "/C=US/ST=CA/L=San Francisco/O=Ihre Firma, Inc./OU=IT/CN=yourdomain.com"

Alternatively, you can create CSR via an CSR generator tool.


Generate the Private Key with OpenSSL

To generate your private key, you need to specify the key algorithm, the key size, and an optional passphrase. The standard key algorithm is RSA, but you can also select ECDSA for specific situations. When choosing a key algorithm, make sure you won’t run into compatibility issues. In this article, we only show how to generate a private key via the RSA algorithm.

Als Schlüsselgröße sollten Sie bei Verwendung des RSA-Schlüsselalgorithmus 2048 Bit und bei Verwendung des ECDSA-Algorithmus 256 Bit wählen. Eine Schlüsselgröße von weniger als 2048 ist nicht sicher, während ein höherer Wert die Leistung beeinträchtigen kann.

Schließlich sollten Sie entscheiden, ob Sie eine Passphrase für Ihren privaten Schlüssel benötigen oder nicht. Bitte beachten Sie, dass bestimmte Server keine privaten Schlüssel mit Passphrasen akzeptieren.

Sobald Sie bereit sind, Ihren privaten Schlüssel (mit RSA-Algorithmus) zu generieren, führen Sie die folgenden Befehle aus:

openssl genrsa -out ihrdomain.schlüssel 2048

This command will create the yourdomain.key file in your current directory. Your private key will be in the PEM format.


View the Private Key Information with OpenSSL

Sie können den verschlüsselten Inhalt Ihres privaten Schlüssels mit dem folgenden Befehl anzeigen:

cat yourdomain.key


Decode the Private Key with OpenSSL

Um Ihren privaten Schlüssel zu entschlüsseln, führen Sie den folgenden Befehl aus:

openssl rsa -text -in yourdomain.key -noout


Extract the Public Key with OpenSSL

Um Ihren öffentlichen Schlüssel aus dem privaten Schlüssel zu extrahieren, verwenden Sie den folgenden Befehl:

openssl rsa -in ihredomain.schlüssel -pubout -out ihredomain_public.schlüssel


Create Your Private Key and CSR at Once with OpenSSL

OpenSSL is so versatile, there’s also a command to generate both your private key and CSR:

openssl req -out yourdomain.csr -new -newkey rsa:2048 -nodes -keyout yourdomain.key

Dieser Befehl erzeugt den privaten Schlüssel ohne Passphrase (-keyout yourdomain.key) und den CSR-Code (out yourdomain.csr).


Check the CSR Info with OpenSSL

Um sicherzustellen, dass Sie die richtigen Informationen angegeben haben, bevor Sie die CSR an Ihre Zertifizierungsstelle übermitteln, führen Sie den folgenden Befehl aus:

openssl req -text -in yourdomain.csr -noout -verify


Send the CSR to the CA

Run the following command to view and copy the entire contents of the CSR:

cat yourdomain.csr

Make sure you include —–BEGIN CERTIFICATE REQUEST—– and —–END CERTIFICATE REQUEST— tags, and paste everything into your SSL vendor’s order form.


Check a Certificate in OpenSSL

Nachdem Ihre Zertifizierungsstelle das SSL-Zertifikat an Ihren Posteingang übermittelt hat, führen Sie den folgenden Befehl aus, um sicherzustellen, dass die Informationen des Zertifikats mit Ihrem privaten Schlüssel übereinstimmen.

openssl x509 -text -in yourdomain.crt -noout

This concludes our list of common OpenSSL commands. If you want, you can study all the OpenSSL commands.


Bottom Line

Now that you know what is OpenSSL and how it works, you can use its commands to generate, manage and install SSL certificates on various servers. Using OpenSSL is, sometimes, the only option when you don’t have a web hosting panel.

It may take a while before you get comfortable with OpenSSL commands, but the more you use them, the better SSL certificate management becomes.

If you’re looking for more information on what OpenSSL is and how it works, this free book is an excellent resource.

Häufig gestellte Fragen

Was ist der Unterschied zwischen SSL und OpenSSL?

SSL steht für Secure Sockets Layer, ein inzwischen veraltetes kryptografisches Protokoll, das die Kommunikation zwischen zwei Computeranwendungen über ein Netzwerk verschlüsselt. Wenn wir von SSL-Zertifikaten sprechen, handelt es sich eigentlich um TLS-Zertifikate (Transport Layer Security), dem Nachfolger von SSL. Erfahren Sie mehr über den Unterschied zwischen SSL und TLS.

OpenSSL hingegen ist ein kryptografisches Dienstprogramm, das die Erzeugung, Installation und Identifizierung von SSL/TLS-Zertifikaten über Befehlszeilen verwaltet.

Link kopieren

Ist die Verwendung von OpenSSL kostenlos?

Ja, OpenSSL kann für kommerzielle und nichtkommerzielle Zwecke frei verwendet werden.

Link kopieren

Sparen Sie 10% auf SSL-Zertifikate, wenn Sie noch heute bestellen!

Schnelle Ausstellung, starke Verschlüsselung, 99,99% Browser-Vertrauen, engagierter Support und 25-tägige Geld-zurück-Garantie. Gutscheincode: SAVE10

Geschrieben von

Erfahrener Content-Autor, spezialisiert auf SSL-Zertifikate. Verwandeln Sie komplexe Cybersicherheitsthemen in klare, ansprechende Inhalte. Tragen Sie durch wirkungsvolle Narrative zur Verbesserung der digitalen Sicherheit bei.