createTLSStream - multiple declarations
- Function createTLSStream
- Function createTLSStream
Function 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.
Prototype
TLSStream createTLSStream(
Stream underlying,
TLSContext ctx,
string peer_name = null,
NetworkAddress peer_address = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , )
);
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
.
This constructor allows to specify a custom tunnel state
, which can
be useful when a tunnel has already been established by other means.
Prototype
TLSStream createTLSStream(
Stream underlying,
TLSContext ctx,
TLSStreamState state,
string peer_name = null,
NetworkAddress peer_address = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , )
);
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 |
Authors
Sönke Ludwig
Copyright
© 2012-2014 RejectedSoftware e.K.
License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.