createTLSStream

Constructs a new TLS tunnel, allowing to override the stream state.

This constructor allows to specify a custom tunnel state, which can be useful when a tunnel has already been established by other means.

  1. TLSStream createTLSStream(Stream underlying, TLSContext ctx, string peer_name, NetworkAddress peer_address)
  2. TLSStream createTLSStream(Stream underlying, TLSContext ctx, TLSStreamState state, string peer_name, NetworkAddress peer_address)
    @safe
    createTLSStream
    (
    Stream
    )
    (
    Stream underlying
    ,,,
    string peer_name = null
    ,
    NetworkAddress peer_address = NetworkAddress.init
    )
    if (
    isStream!Stream
    )

Parameters

underlying Stream

The base stream which is used for the TLS tunnel

ctx TLSContext

TLS context used for initiating the tunnel

state TLSStreamState

The manually specified tunnel state

peer_name string

DNS name of the remote peer, used for certificate validation

peer_address NetworkAddress

IP address of the remote peer, used for certificate validation

Meta