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.

StreamPeerTLS

Hérite de : StreamPeer < RefCounted < Object

Un pair de flux qui gère des connexions TLS.

Description

A stream peer that handles TLS connections. This object can be used to connect to a TLS server or accept a single TLS client connection.

Note: When exporting to Android, make sure to enable the INTERNET permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.

Tutoriels

Méthodes

Error

accept_stream(stream: StreamPeer, server_options: TLSOptions)

Error

connect_to_stream(stream: StreamPeer, common_name: String, client_options: TLSOptions = null)

void

disconnect_from_stream()

Status

get_status() const

StreamPeer

get_stream() const

void

poll()


Énumérations

enum Status: 🔗

Status STATUS_DISCONNECTED = 0

Un statut représentant un StreamPeerTLS qui est déconnecté.

Status STATUS_HANDSHAKING = 1

Un status représentant un StreamPeerTLS durant la poignée de main.

Status STATUS_CONNECTED = 2

A status representing a StreamPeerTLS that is connected to a host.

Status STATUS_ERROR = 3

Un statut représentant un StreamPeerTLS dans un état d'erreur.

Status STATUS_ERROR_HOSTNAME_MISMATCH = 4

An error status that shows a mismatch in the TLS certificate domain presented by the host and the domain requested for validation.


Descriptions des méthodes

Error accept_stream(stream: StreamPeer, server_options: TLSOptions) 🔗

Accepte une connexion de pair en tant que serveur en utilisant server_options. Voir TLSOptions.server().


Error connect_to_stream(stream: StreamPeer, common_name: String, client_options: TLSOptions = null) 🔗

Connects to a peer using an underlying StreamPeer stream and verifying the remote certificate is correctly signed for the given common_name. You can pass the optional client_options parameter to customize the trusted certification authorities, or disable the common name verification. See TLSOptions.client() and TLSOptions.client_unsafe().


void disconnect_from_stream() 🔗

Se déconnecte de l'hôte.


Status get_status() const 🔗

Renvoie le statut de la connexion.


StreamPeer get_stream() const 🔗

Returns the underlying StreamPeer connection, used in accept_stream() or connect_to_stream().


void poll() 🔗

Sonde la connexion pour vérifier les octets entrants. Appelez ceci avant StreamPeer.get_available_bytes() pour que ça puisse fonctionner correctement.