Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Quic.Tls

Feature notes: Asynchronous QUIC server and HTTP/3 component

Classes, interfaces and records

classtQuicTLSConnection

Owns a record-free TLS session, connection state and real packet ciphers. aHost must outlive this instance. Configure DNS, groups and ALPN through TLS before Start. Calls require external serialization and must not reenter this instance, including from TLS events. Callbacks only queue data or install keys; the pump supplies CRYPTO bytes after TLS returns.

Output buffers retain their shared read-only contract. PacketSent is a separate notification after actual transmission; protecting or dequeuing a packet does not discard Initial keys. OpenPacket authenticates before updating receive packet numbers or acting on reserved bits. The caller supplies framing, ACK/recovery, retransmission retention and close timers.

constructor Create(aHost: TsmStreamSecII; aRole: tQuicRole; aVersion: Cardinal; const aInitialDestinationID, aLocalParameters: TBytes; const aParameterContext: tQuicTransportParameterContext; aVersionPolicy: tQuicClientNegotiation = nil); destructor Destroy; override; procedure SetVersionPolicy(aPolicy: tQuicClientNegotiation);
The borrowed policy must outlive this bridge. Set only before Start.
procedure ApplyRetry(const aDestinationID: TBytes; const aContext: tQuicTransportParameterContext);
Retains the TLS transcript and packet-number state. The caller validates Retry, resets recovery and retransmits retained Initial CRYPTO.
procedure ConfigureEarlyData(const aContext: TBytes); procedure ConfigureEarlyPeerParameters(const aParameters: tQuicTransportParameters); property EarlyDataOffered: Boolean read GetEarlyDataOffered; property EarlyDataAccepted: Boolean read GetEarlyDataAccepted; property EarlyDataRejected: Boolean read GetEarlyDataRejected; property EarlyDataWindowOpen: Boolean read GetEarlyDataWindowOpen; procedure Start; procedure ReceiveCrypto(aLevel: tQuicEncryptionLevel; aOffset: UInt64; const aData: TBytes); procedure ProcessCryptoInput;
Dispatch the whole authenticated frame batch before pumping TLS, so a key-level transition cannot discard state needed by trailing frames.
procedure SynchronizeKeys;
Releases packet ciphers whose keys the dispatcher has discarded. Does not notify the connection that a packet was sent or received.
procedure ReleaseSession;
After terminal expiry, release the TLS session while retaining the closed core for diagnostics. TLS is nil afterwards; packet keys are discarded.
procedure DetachDestroyedSession;
Terminal teardown only, after the borrowed host has already destroyed its TLS sessions. Never dereference or release that stale session. The caller must have stopped all I/O and may only destroy this bridge next.
function TakeCryptoOutput(out aChunk: tQuicCryptoChunk): Boolean; function ProtectPacket(aLevel: tQuicEncryptionLevel; const aHeader, aPayload: TBytes; aPacketNumber: UInt64; aPacketNumberOffset: Integer): TBytes; function OpenPacket(aLevel: tQuicEncryptionLevel; const aPacket: TBytes; aPacketNumberOffset: Integer; out aHeader, aPayload: TBytes; out aPacketNumber: UInt64): Boolean;
Outputs must be distinct variables and distinct from aPacket. Failure explicitly returns empty arrays and packet number zero. Unavailable keys and pre-completion 1-RTT packets return False for the caller's bounded undecryptable-packet queue or discard policy.
function AuthenticatePacket(aLevel: tQuicEncryptionLevel; const aPacket: TBytes; aPacketNumberOffset: Integer; out aHeader, aPayload: TBytes; out aPacketNumber: UInt64): Boolean;
Authentication only: the dispatcher commits packet-number receipt and key-discard transitions after validating the complete frame batch. Output and failure contracts are the same as OpenPacket.
procedure SetKeyContext(aNowMicros, aPtoMicros: UInt64);
Supply the transport clock and current base PTO before packet work.
function RequestKeyUpdate: Boolean; function KeyUpdateDeadline(out aDeadline: UInt64): Boolean; procedure AckFrameValidated(const aFrame: tQuicFrame);
ACK ranges must already have passed sent-history validation.
procedure PacketSent(aPacketNumber: UInt64; const aPayload: TBytes; aNowMicros: UInt64); overload;
Policy notification after actual 1-RTT UDP transmission. The dispatcher retains responsibility for connection packet-sent transitions.
procedure PacketSent(aLevel: tQuicEncryptionLevel); overload; procedure ReceiveHandshakeDone; property KeyUpdates: tQuicKeyUpdate read fKeyUpdates;
Borrowed diagnostic state. Packet operations remain serialized here.
property TLS: TTLS_ContentLayer read fTLS; property State: tQuicConnectionState read fState;