Skip to content

Capture Modes

Keylog Mode ​

Use --model keylog (alias -m key) when you already record the network packets separately. eCapture writes the session secrets for the chosen TLS implementation in NSS Key Log format. In v2.12.0 the collector requires an explicit local --keylogfile (-k) path.

bash
sudo ecapture tls --model keylog --keylogfile openssl.keys
sudo ecapture gotls --elfpath ./go-client --model keylog --keylogfile go.keys
sudo ecapture gnutls --model keylog --keylogfile gnutls.keys

Start one of these commands and your packet capture before opening a fresh TLS connection. Keylog mode itself does not require a capture interface. If a shared library is in a private installation, identify it with --libssl or --gnutls as appropriate.

Recognize and use the key log ​

Each line consists of a label, the connection's client random, and the corresponding secret, separated by spaces. TLS 1.2 commonly uses CLIENT_RANDOM. TLS 1.3 uses separate entries for client/server handshake and application traffic. The placeholders below illustrate the three fields in the native file.

text
CLIENT_RANDOM <client-random-hex> <master-secret-hex>
CLIENT_HANDSHAKE_TRAFFIC_SECRET <client-random-hex> <secret-hex>
SERVER_TRAFFIC_SECRET_0 <client-random-hex> <secret-hex>

A key log has no packet timestamps, ordering or application bytes. In Wireshark's Protocols → TLS preferences, set the key log filename for the matching packet trace. Find a request unique to your test. For an equivalent command-line check, see Wireshark decryption workflows. Store the key log with the same access controls as the decrypted data. Keylog format

Delivering the result ​

--output runtime.jsonl saves runtime logs only in this mode. Terminal output labels NSS lines as events in v2.12.0. For remote delivery, TCP and WebSocket publish v2 KEYLOG events, and a receiver reconstructs the NSS file from the ordered keylog.data bytes. The local --keylogfile remains required even when a network receiver is configured. Receiver contract

Keylog Mode has loaded

Released under the MIT License.