TLSClient

TLS Client

Constructors

this
this(void delegate(in ubyte[]) socket_output_fn, void delegate(in ubyte[]) proc_cb, void delegate(in TLSAlert, in ubyte[]) alert_cb, bool delegate(in TLSSession) handshake_cb, TLSSessionManager session_manager, TLSCredentialsManager creds, TLSPolicy policy, RandomNumberGenerator rng, TLSServerInformation server_info, TLSProtocolVersion offer_version, Vector!string next_protocols, size_t reserved_io_buffer_size)

Set up a new TLS client session

Members

Functions

getPeerCertChain
Vector!X509Certificate getPeerCertChain(HandshakeState state)
Undocumented in source. Be warned that the author may not have intended to support it.
initiateHandshake
void initiateHandshake(HandshakeState state, bool force_full_renegotiation)

Send a new client hello to renegotiate

newHandshakeState
HandshakeState newHandshakeState(HandshakeIO io)
Undocumented in source. Be warned that the author may not have intended to support it.
processHandshakeMsg
void processHandshakeMsg(HandshakeState active_state, HandshakeState state_base, HandshakeType type, Vector!ubyte contents)

Process a handshake message

sendClientHello
void sendClientHello(HandshakeState state_base, bool force_full_renegotiation, TLSProtocolVersion _version, string srp_identifier, Vector!string next_protocols)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From TLSChannel

receivedData
size_t receivedData(const(ubyte)* input, size_t input_size)

Inject TLS traffic received from counterparty

receivedData
size_t receivedData(Vector!ubyte buf)

Inject TLS traffic received from counterparty

send
void send(const(ubyte)* buf, size_t buf_size)

Inject plaintext intended for counterparty Throws an exception if isActive() is false

send
void send(string str)

Inject plaintext intended for counterparty Throws an exception if isActive() is false

send
void send(Vector!(char, Alloc) val)

Inject plaintext intended for counterparty Throws an exception if isActive() is false

sendAlert
void sendAlert(TLSAlert alert)

Send a TLS alert message. If the alert is fatal, the internal state (keys, etc) will be reset.

sendWarningAlert
void sendWarningAlert(TLSAlertType type)

Send a warning alert

sendFatalAlert
void sendFatalAlert(TLSAlertType type)

Send a fatal alert

close
void close()

Send a close notification alert

isActive
bool isActive()
isClosed
bool isClosed()
renegotiate
void renegotiate(bool force_full_renegotiation)

Attempt to renegotiate the session

peerSupportsHeartbeats
bool peerSupportsHeartbeats()
heartbeatSendingAllowed
bool heartbeatSendingAllowed()
heartbeat
void heartbeat(const(ubyte)* payload, size_t payload_size)

Attempt to send a heartbeat message (if negotiated with counterparty)

heartbeat
void heartbeat()

Attempt to send a heartbeat message (if negotiated with counterparty)

peerCertChain
Vector!X509Certificate peerCertChain()
keyMaterialExport
const(SymmetricKey) keyMaterialExport(string label, string context, size_t length)

Key material export (RFC 5705)

applicationProtocol
const(string) applicationProtocol()

Returns the ALPN chosen in the ServerHello with the ALPN extention

sessionId
const(ubyte[]) sessionId()

Returns the current session ID

~this
~this()
Undocumented in source.
processHandshakeMsg
void processHandshakeMsg(HandshakeState active_state, HandshakeState pending_state, HandshakeType type, Vector!ubyte contents)
Undocumented in source.
initiateHandshake
void initiateHandshake(HandshakeState state, bool force_full_renegotiation)
Undocumented in source.
getPeerCertChain
Vector!X509Certificate getPeerCertChain(HandshakeState state)
Undocumented in source.
newHandshakeState
HandshakeState newHandshakeState(HandshakeIO io)
Undocumented in source.
createHandshakeState
HandshakeState createHandshakeState(TLSProtocolVersion _version)
Undocumented in source. Be warned that the author may not have intended to support it.
timeoutCheck
bool timeoutCheck()

Perform a handshake timeout check. This does nothing unless this is a DTLS channel with a pending handshake state, in which case we check for timeout and potentially retransmit handshake packets.

activateSession
void activateSession()
Undocumented in source. Be warned that the author may not have intended to support it.
changeCipherSpecReader
void changeCipherSpecReader(ConnectionSide side)
Undocumented in source. Be warned that the author may not have intended to support it.
changeCipherSpecWriter
void changeCipherSpecWriter(ConnectionSide side)
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationCheck
void secureRenegotiationCheck(ClientHello client_hello)
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationCheck
void secureRenegotiationCheck(ServerHello server_hello)
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationDataForClientHello
Vector!ubyte secureRenegotiationDataForClientHello()
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationDataForServerHello
Vector!ubyte secureRenegotiationDataForServerHello()
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationSupported
bool secureRenegotiationSupported()
rng
RandomNumberGenerator rng()
Undocumented in source. Be warned that the author may not have intended to support it.
sessionManager
TLSSessionManager sessionManager()
Undocumented in source. Be warned that the author may not have intended to support it.
saveSession
bool saveSession(TLSSession session)
Undocumented in source. Be warned that the author may not have intended to support it.
resetState
void resetState()
Undocumented in source. Be warned that the author may not have intended to support it.
m_application_protocol
string m_application_protocol;
Undocumented in source.
m_session_manager
TLSSessionManager m_session_manager;
Undocumented in source.

Meta