Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add key log callback option to SSLContext #861

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Add key log callback option to SSLContext #861

merged 2 commits into from
Mar 14, 2024

Conversation

chrisvest
Copy link
Contributor

Motivation:
Wireshark can decrypt TLS sessions during packet capture, if the session keys (etc.) are available from an SSL key log file. This log file format has become a de facto industry standard, and BoringSSL (and maybe the others too, didn't check) has a callback mechanism for delivering log lines in this format.

Modification:
Add KeyLogCallback interface and an SSLContext.setKeyLogCallback method, which integrators can easily implement the SSLKEYLOGFILE feature, or equivalent, on top of.

Result:
It is now possible to configure netty-tcnative in a way that TLS sessions can be decrypted at packet-capture time by Wireshark, making it easier to investigate and debug problems with TLS.

Motivation:
Wireshark can decrypt TLS sessions during packet capture, if the session keys (etc.) are available from an SSL key log file.
This log file format has become a de facto industry standard, and BoringSSL (and maybe the others too, didn't check) has a callback mechanism for delivering log lines in this format.

Modification:
Add `KeyLogCallback` interface and an `SSLContext.setKeyLogCallback` method, which integrators can easily implement the SSLKEYLOGFILE feature, or equivalent, on top of.

Result:
It is now possible to configure netty-tcnative in a way that TLS sessions can be decrypted at packet-capture time by Wireshark, making it easier to investigate and debug problems with TLS.
@chrisvest
Copy link
Contributor Author

Maybe relevant to your interests as well, @hyperxpro.

@chrisvest
Copy link
Contributor Author

Not only a de facto standard, but perhaps on its way to becoming a formalized standard as well: https://datatracker.ietf.org/doc/draft-ietf-tls-keylogfile/

Copy link
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking looks good. Just two nits.

openssl-dynamic/src/main/c/sslcontext.c Outdated Show resolved Hide resolved
@hyperxpro
Copy link
Contributor

I will write an example for this and try to couple it with PcapWriteHandler.

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
@chrisvest chrisvest merged commit 0cb6518 into main Mar 14, 2024
7 checks passed
@chrisvest chrisvest deleted the sslkeylogfile branch March 14, 2024 20:04
@chrisvest chrisvest added this to the 2.0.66.Final milestone Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants