Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jmayclin
Copy link
Contributor

Goal

Add an API surfacing whether a handshake used mutual auth, and use that in tests.

Why

Our benchmarks don't currently assert on the handshake type. This is a gap in testing.

How

We add a new method to the TlsInfo trait, and implement it for all of the implementations.

Testing

I added the assertions to the "all handshakes" test.

Related

Related to the rust integration tests.

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

@jmayclin jmayclin requested review from goatgoose and maddeleine July 24, 2025 17:35
@github-actions github-actions bot added the s2n-core team label Jul 24, 2025
@jmayclin jmayclin self-assigned this Jul 24, 2025
fn mutual_auth(&self) -> bool {
let handshake_type = self.connection.handshake_type().unwrap();
assert!(handshake_type.contains("NEGOTIATED"));
handshake_type.contains("CLIENT_AUTH")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think CLIENT_AUTH can appear when a client certificate message is sent containing no certificate? I think we'd still want to indicate no mutual auth in that case?

If this is the case, maybe checking client_cert_used() is better?

* use client_cert_used instead of checking the handshake type
@jmayclin jmayclin requested a review from goatgoose July 24, 2025 18:18
@jmayclin jmayclin enabled auto-merge (squash) July 24, 2025 21:21
@jmayclin jmayclin merged commit cc20edb into aws:main Jul 25, 2025
50 checks passed
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.

3 participants