Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
TLS/SSL certificates
Einführung
It is often desired to use TLS connections (also known as SSL connections) for communications to avoid "man in the middle" attacks. Godot has a connection wrapper, StreamPeerTLS, which can take a regular connection and add security around it. The HTTPClient and HTTPRequest classes also support HTTPS using this same wrapper.
Godot will try to use the TLS certificate bundle provided by the operating system, but also includes the TLS certificate bundle from Mozilla as a fallback.
You can alternatively force your own certificate bundle in the Project Settings:
Einstellung des TLS-Zertifikat-Bundles überschreibt die Projekteinstellung
When set, this file overrides the operating system provided bundle by default. This file should contain any number of public certificates in PEM format.
Es gibt zwei Wege Zertifikate zu erhalten:
Erzeugen Sie ein selbst signiertes Zertifikat
Für die meisten Anwendungsfälle empfiehlt es sich, über eine Zertifizierungsstelle zu gehen, da der Prozess bei Zertifizierungsstellen wie Let's Encrypt kostenlos ist. Wenn die Verwendung einer Zertifizierungsstelle jedoch keine Option ist, können Sie ein selbstsigniertes Zertifikat erstellen und dem Client mitteilen, dass er Ihr selbstsigniertes Zertifikat als vertrauenswürdig betrachten soll.
Um ein selbstsigniertes Zertifikat zu erstellen, erzeugen Sie ein Schlüsselpaar aus privatem und öffentlichem Schlüssel und fügen den öffentlichen Schlüssel (im PEM-Format) zu der in den Projekteinstellungen angegebenen CRT-Datei hinzu.
Warnung
Der private Schlüssel sollte nur auf Ihrem Server liegen. Der Client darf keinen Zugang zu ihm haben: Andernfalls ist die Sicherheit des Zertifikats gefährdet.
Warnung
When specifying a self-signed certificate as TLS bundle in the project settings, normal domain name validation is enforced via the certificate CN and alternative names. See TLSOptions to customize domain name validation.
For development purposes Godot can generate self-signed certificates via Crypto.generate_self_signed_certificate.
Alternatively, OpenSSL has some documentation about generating keys and certificates.