Class StreamPeerTLS
A stream peer that handles TLS connections.
- Inheritance
-
StreamPeerTLS
Remarks
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.
See Also
Methods
accept_stream(StreamPeer, TLSOptions)
Accepts a peer connection as a server using the given server_options
. See TLSOptions.server.
int accept_stream(StreamPeer stream, TLSOptions server_options)
Parameters
stream
StreamPeerserver_options
TLSOptions
connect_to_stream(StreamPeer, String, TLSOptions)
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.
int connect_to_stream(StreamPeer stream, String common_name, TLSOptions client_options)
Parameters
stream
StreamPeercommon_name
Stringclient_options
TLSOptions
disconnect_from_stream
Disconnects from host.
void disconnect_from_stream
get_status
Qualifiers: const
Returns the status of the connection. See Status for values.
int get_status
get_stream
Qualifiers: const
Returns the underlying StreamPeer connection, used in StreamPeerTLS.accept_stream or StreamPeerTLS.connect_to_stream.
StreamPeer get_stream
poll
Poll the connection to check for incoming bytes. Call this right before get_available_bytes for it to work properly.
void poll