refactor(tls-harness): use single test pair IO to allow for decryption#5648
Merged
refactor(tls-harness): use single test pair IO to allow for decryption#5648
Conversation
kaukabrizvi
approved these changes
Dec 4, 2025
maddeleine
approved these changes
Dec 4, 2025
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.
Goal
Allows TLS 1.3 decryption in integration tests.
Why
This will make it much easier to assert on certain qualities without having to reach into library internals. This is specifically motivated by TLS 1.3 Group Negotiation integration tests.
E.g. my draft of that test is here
How
It uses brass-aphid-wire. This is a series of crates that I wrote which allow for runtime TLS decryption of s2n-tls/rustls/openssl. Basically, wireshark but it's in-process and synchronous. This means that instead of having to faff about with packet captures and sockets, we can just directly plug it into our shared-memory IO test harness.
To use brass-aphid-wire, it requires both the client and server to have access to the StreamDecrypter. To achieve this I just made the actual
TestPairIOreference counted, and now the client and server each get their own copy of that, instead of having to just reference count the individual fields that they want.Callouts
This only works for TLS 1.3. my crates doesn't (currrently) support TLS 1.2
Testing
I added a unit test confirming decryption success/results.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.