test(integration): add mTLS integration tests#5638
Merged
kaukabrizvi merged 31 commits intoaws:mainfrom Dec 4, 2025
Merged
Conversation
maddeleine
reviewed
Nov 26, 2025
jmayclin
reviewed
Dec 1, 2025
bindings/rust/extended/s2n-tls/src/callbacks/cert_validation.rs
Outdated
Show resolved
Hide resolved
bindings/rust/extended/s2n-tls/src/callbacks/cert_validation.rs
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@jmayclin @maddeleine For async cert validation, instead of extending the Rust public API, the integration tests now register an async cert validation callback directly via s2n_tls_sys::s2n_config_set_cert_validation_cb. The tests define a C-style callback (test_async_cert_cb) and a small context struct that tracks invocation count and sends the s2n_cert_validation_info* over a channel. The async tests then call s2n_cert_validation_accept on that pointer to resume the handshake. This lets us exercise the async cert validation path end-to-end without exposing any new async Rust API surface. |
jmayclin
approved these changes
Dec 3, 2025
Co-authored-by: James Mayclin <maycj@amazon.com>
maddeleine
approved these changes
Dec 3, 2025
This was referenced Dec 5, 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
Add mTLS integration tests for certificate-validation callbacks that exercise both synchronous and asynchronous validation across TLS versions and implementations, without changing the public Rust callback API. (This PR adds Rustls↔s2n coverage; additional libraries will be added in follow-up work.)
Why
The existing Rust bindings only supported synchronous certificate validation. We still need async coverage to match the C API and to ensure regression coverage for real-world mTLS deployments. Adding these integration tests gives us the missing end-to-end mTLS coverage required to detect changes in cert-validation behavior with different peers and protocol versions.
How
'staticbound blocks async interfaces #5469 is resolved.Callouts
Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.