ddn.net.tls.stream
Native TLS stream implementation.
Provides the encrypted stream for reading and writing application data over a TLS connection. Supports non-blocking I/O via TlsProgress return values. Manages handshake state, negotiated parameters, and the underlying transport.
enum ShutdownState
class NativeTlsStream
Types 2
enumShutdownState
Shutdown state machine phases.
NOT_STARTED
SEND_CLOSE_NOTIFY
WAIT_CLOSE_NOTIFY
DONE
classNativeTlsStream : TlsStream
Native TLS stream using pure D cryptographic primitives.
Wraps a TlsTransport and provides TLS encryption/decryption. All potentially-blocking operations return TlsProgress or TlsResult to support non-blocking I/O.
Fields
TlsTransport transport_TlsRole role_string serverName_TlsHandshakeState handshakeState_TlsVersion negotiatedVersion_CipherSuiteId cipherSuiteId_string cipherSuite_string alpnProtocol_TlsCertificateChain peerCerts_TlsSession session_TlsVerifyCallback verifyCallback_TlsVerifyMode verifyMode_ubyte[] readBuffer_size_t readPos_ubyte[] applicationReadBuffer_size_t applicationReadPos_TlsError lastError_ShutdownState shutdownState_bool receivedCloseNotify_RecordLayer handshakeRecordLayer_Tls13Client tls13Client_Tls12Client tls12Client_Tls13Server tls13Server_Tls12Server tls12Server_bool serverHelloPeeked_bool serverUseTls13_TlsVersion minVersion_TlsVersion maxVersion_string[] cipherSuites_string[] alpnProtocols_ubyte[][] serverCertChainDer_string serverCertChainPem_string serverPrivateKeyPem_TlsSessionCache sessionCache_NativeTlsTrustStore trustStore_TlsAead writeAead_TlsAead readAead_Methods
TlsProgress handshake()Performs or continues the TLS handshake.TlsProgress flush()Flushes any buffered data through the TLS layer.TlsProgress shutdown()Initiates graceful TLS shutdown (sends close_notify).void close()private
TlsProgress sendCloseNotify()private
void initHandshakeEngine()private
TlsProgress driveHandshake()private
TlsProgress driveServerHandshake()private
void finalizeHandshake()private
bool detectTls13ClientHello(const(ubyte)[] fragment)private
void applyEngineResult(CipherSuiteId cs, string alpn,
TlsCertificateChain peerCerts, TlsSession tlsSession)private
TlsResult readEncrypted(ubyte[] buffer)private
TlsResult writeEncrypted(const(ubyte)[] data)private
TlsRecord readTlsRecord()Constructors
this(TlsTransport transport, TlsRole role, string serverName,
TlsVersion minVersion, TlsVersion maxVersion,
TlsVerifyMode verifyMode, TlsVerifyCallback verifyCallback)Constructs a NativeTlsStream.