SSL stream peer.
    public class StreamPeerSSL : StreamPeer

SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection.

Inheritance Chain

Constructors

    public StreamPeerSSL()

Properties

    public bool BlockingHandshake { get; set; }

Methods

    public Error AcceptStream(StreamPeer stream, CryptoKey privateKey, X509Certificate certificate, X509Certificate chain = null)

Accepts a peer connection as a server using the given privateKey and providing the given certificate to the client. You can pass the optional chain parameter to provide additional CA chain information along with the certificate.

    public Error ConnectToStream(StreamPeer stream, bool validateCerts = false, string forHostname = "", X509Certificate validCertificate = null)

Connects to a peer using an underlying StreamPeer stream. If validateCerts is true, StreamPeerSSL will validate that the certificate presented by the peer matches the forHostname.

    public void DisconnectFromStream()

Disconnects from host.

    public Status GetStatus()

Returns the status of the connection. See Status for values.

    [Obsolete("IsBlockingHandshakeEnabled is deprecated. Use the BlockingHandshake property instead.")]
    public bool IsBlockingHandshakeEnabled()

Getter for BlockingHandshake

    public void Poll()

Poll the connection to check for incoming bytes. Call this right before StreamPeer.GetAvailableBytes() for it to work properly.

    [Obsolete("SetBlockingHandshakeEnabled is deprecated. Use the BlockingHandshake property instead.")]
    public void SetBlockingHandshakeEnabled(bool enabled)

Setter for BlockingHandshake

Inner Types

Status

Name Value Description
Disconnected 0 A status representing a [StreamPeerSSL] that is disconnected.
Handshaking 1  
Connected 2 A status representing a [StreamPeerSSL] that is connected to a host.
Error 3  
ErrorHostnameMismatch 4 An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation.
Tags: