ddn.net.tls.session
TLS session and session cache implementations.
Provides concrete implementations of TlsSession and TlsSessionCache for TLS session resumption support.
Types 3
classNativeTlsSession : TlsSession
TLS session implementation for session resumption.
Stores session identifier, ticket data, and expiration time. Sessions can be serialized for external storage and later deserialized using NativeTlsContext.deserializeSession().
Fields
private ubyte[] sessionId_private ubyte[] sessionTicket_private long expirationTime_Methods
NativeTlsSession deserialize(const(ubyte)[] data) staticDeserializes a session from bytes previously produced by `serialize()`.Constructors
this(const(ubyte)[] sid, const(ubyte)[] ticket, long expires)Constructs a NativeTlsSession.Thread-safe in-memory session cache.
Stores TLS sessions keyed by server hostname. Provides automatic expiration pruning.
Fields
private TlsSession[string] sessions_Methods
void store(string serverName, TlsSession session)Stores a session for later resumption.TlsSession retrieve(string serverName)Retrieves a session for resumption.void remove(string serverName)Removes a session from the cache.void pruneExpired()Removes all expired sessions from the cache.void clear()Clears all sessions from the cache.structTlsNewSessionTicketInfo
Parsed NewSessionTicket message (RFC 8446 §4.6.1).
Fields
uint lifetimeSecondsTicket lifetime hint in seconds (capped at 7 days by the RFC).ubyte[] ticketOpaque ticket bytes issued by the server.Functions 1
fn
TlsNewSessionTicketInfo parseNewSessionTicket(const(ubyte)[] message) @safe pureParses a NewSessionTicket handshake message.