ddn.net.tls.session

TLS session and session cache implementations.

Provides concrete implementations of TlsSession and TlsSessionCache for TLS session resumption support.

Types 2

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
ubyte[] sessionId_
ubyte[] sessionTicket_
long expirationTime_
Methods
const(ubyte)[] sessionId() @property const
const(ubyte)[] sessionTicket() @property const
long expirationTime() @property const
bool isValid() @property const
ubyte[] serialize() constSerializes the session for external storage.
NativeTlsSession deserialize(const(ubyte)[] data)Deserializes 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
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.
size_t length() @property constReturns: The number of sessions in the cache.