createTLSStream

Constructs a new TLS tunnel and infers the stream state from the TLSContextKind.

Depending on the TLSContextKind of ctx, the tunnel will try to establish an TLS tunnel by either passively accepting or by actively connecting.

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

Parameters

underlying Stream

The base stream which is used for the TLS tunnel

ctx TLSContext

TLS context used for initiating the tunnel

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