createTLSStream - multiple declarations
Function createTLSStream
Constructs a new TLS tunnel and infers the stream state from the TLSContextKind.
TLSStream createTLSStream(Stream)
(
Stream underlying,
TLSContext ctx,
string peer_name = null,
NetworkAddress peer_address = NetworkAddress .init
)
if (isStream!Stream);
Depending on the TLSContextKind of ctx, the tunnel will try to establish an TLS tunnel by either passively accepting or by actively connecting.
Parameters
Name | Description |
---|---|
underlying | The base stream which is used for the TLS tunnel |
ctx | TLS context used for initiating the tunnel |
peer_name | DNS name of the remote peer, used for certificate validation |
peer_address | IP address of the remote peer, used for certificate validation |
Function createTLSStream
Constructs a new TLS tunnel, allowing to override the stream state.
TLSStream createTLSStream(Stream)
(
Stream underlying,
TLSContext ctx,
TLSStreamState state,
string peer_name = null,
NetworkAddress peer_address = NetworkAddress .init
)
if (isStream!Stream);
This constructor allows to specify a custom tunnel state, which can be useful when a tunnel has already been established by other means.
Parameters
Name | Description |
---|---|
underlying | The base stream which is used for the TLS tunnel |
ctx | TLS context used for initiating the tunnel |
state | The manually specified tunnel state |
peer_name | DNS name of the remote peer, used for certificate validation |
peer_address | IP address of the remote peer, used for certificate validation |