TLS Record Analysis

pcapkit.foundation.analysis.tls contains tls_record() only, which decodes a TLS record that TLS reassembled from a TCP stream (RFC 9846 Section 5). The decode itself is TLS.analyze_record.

Added in version 1.9.0.

pcapkit.foundation.analysis.tls.tls_record(datagram)[source]

Parse a TLS record reassembled by TLS.

The record is decoded by TLS.analyze_record, as a segment’s first record is, so a record split across segments decodes as a whole one does.

Parameters:

datagram (Datagram) – Reassembled record (reasm.tls.datagram).

Return type:

ProtocolBase | None

Returns:

The record, as a TLS instance, or Raw if it does not decode. None if datagram is incomplete, as its missing octets cannot be decoded.

Note

Datagram.packet holds the same result, decoded on its first read, unless the reassembly’s __protocol_type__ names another protocol, whose analyze_record then decodes it instead.