Inherits: StreamPeer < Reference < Object

Category: Core

Brief Description

SSL Stream peer.


Error accept_stream ( StreamPeer base )
Error connect_to_stream ( StreamPeer stream, bool validate_certs=false, String for_hostname=”” )
void disconnect_from_stream ( )
Status get_status ( ) const
void poll ( )


enum Status:

  • STATUS_DISCONNECTED = 0 — A status representing a StreamPeerSSL that is disconnected.
  • STATUS_CONNECTED = 2 — A status representing a StreamPeerSSL that is connected to a host.
  • STATUS_ERROR_HOSTNAME_MISMATCH = 4 — An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation.


SSL Stream peer. This object can be used to connect to SSL servers.


Property Descriptions

  • bool blocking_handshake
Setter set_blocking_handshake_enabled(value)
Getter is_blocking_handshake_enabled()

Method Descriptions

Connect to a peer using an underlying StreamPeer “stream”, when “validate_certs” is true, StreamPeerSSL will validate that the certificate presented by the peer matches the “for_hostname”.

  • void disconnect_from_stream ( )

Disconnect from host.

Return the status of the connection, one of STATUS_* enum.

  • void poll ( )

Poll the connection to check for incoming bytes. Call this right before “get_available_bytes()” for it to work properly.