Skip to content

feat(bindings): expose cert validation callback#5357

Merged
CarolYeh910 merged 10 commits intoaws:mainfrom
CarolYeh910:cert_validation_cb_binding
Sep 30, 2025
Merged

feat(bindings): expose cert validation callback#5357
CarolYeh910 merged 10 commits intoaws:mainfrom
CarolYeh910:cert_validation_cb_binding

Conversation

@CarolYeh910
Copy link
Copy Markdown
Contributor

@CarolYeh910 CarolYeh910 commented Jun 13, 2025

Release Summary:

Add a synchronous rust binding API for s2n_cert_validation_callback

Resolved issues:

resolves #5264

Description of changes:

s2n_cert_validation_callback is an unstable async callback that operates on the struct s2n_cert_validation_info. However, due to a lifetime issue (#5469) in our rust bindings, this PR only exposed the synchronous rust API for the cert validation callback.

Code changes breakdown:

  1. Added a new module cert_validation.rs and gated behind feature = "unstable-crl".
  2. Wrapped s2n_cert_validation_info in a Rust struct CertValidationInfo and implemented accept() and reject() methods corresponding to the C APIs.
  3. Defined the trait CertValidationCallbackSync and added a config API set_cert_validation_callback_sync().
  4. Tested the synchronous callback with different outcomes by calling accept() or reject().

Testing:

  • Implemented CertValidationCallbackSync for a test struct SyncCallback
  • Application specific context can be store on Connection via set_application_context()

I ran the unit test locally and confirmed it passed:

$ cargo test --features unstable-crl
...
test callbacks::cert_validation::tests::sync_cert_validation ... ok
...

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jun 13, 2025
@aws aws deleted a comment from github-actions bot Sep 23, 2025
@CarolYeh910 CarolYeh910 added this pull request to the merge queue Sep 29, 2025
Merged via the queue into aws:main with commit befcaa7 Sep 30, 2025
50 checks passed
@CarolYeh910 CarolYeh910 deleted the cert_validation_cb_binding branch September 30, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose s2n_cert_validation_callback in Rust bindings

4 participants