Repository navigation
feat: log TLS secrets to a key log file (SSLKEYLOGFILE) - #47
Merged
Merged
Conversation
server::Config, client::Config and quic::Config get tls_keylog_file: every handshake, over TCP and QUIC, appends its secrets to it in the NSS key log format that Wireshark reads. Empty, the default, logs nothing. The file is opened with the TLS context, created with mode 0600 and appended to one write() per line, so servers, clients and curl can share it; one that cannot be opened fails the Server's construction or the connect. The library does not read SSLKEYLOGFILE; the server and client programs do (server --keylog FILE as well). COROSIO logs QUIC only: corosio's tls_context and stream expose neither SSL_CTX nor SSL, so TLS over TCP warns and goes on without. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pgit
added a commit
that referenced
this pull request
Nov 23, 2026
Brings in #47 (tls_keylog_file), which added a field to quic::Config and ClientConfig in the same places as this branch's tls_verify / verify. Both are kept, the key log field first, as in client::Config, and TlsClientContext sets up the key log after the verify mode either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #46 (
boost-http); this PR is the last commit only, and will retarget tomasteronce #46 is merged.What
server::Config,client::Configandquic::Configgettls_keylog_file. When it is set, every handshake, over TCP and QUIC, appends its secrets to that file in the NSS key log format that Wireshark reads. It is empty by default, and then nothing is logged.write(), so servers, clients and curl can share one file.Server's construction fail, or the connect.SSLKEYLOGFILEitself. Theserverandclientprograms do, andserveralso takes--keylog FILE.docs/capture.rstdescribes the option next to the existing curl/tshark recipe.Limitation
On COROSIO only QUIC is logged. corosio's
tls_contextand stream expose neitherSSL_CTXnorSSL, so TLS over TCP logs a warning and continues without a key log.Tests
In
test/test_client_connect.cpp, for HTTP/1.1, HTTP/2 and HTTP/3:ClientTlsKeyLog.WHEN_keylog_file_is_set_THEN_both_ends_log_the_same_secretsClientTlsBadKeyLog.WHEN_keylog_file_cannot_be_opened_THEN_connect_fails🤖 Generated with Claude Code