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

feat(s2n-quic-tls) Retrieve SNI when the 1-RTT keys are retrieved #2480

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

maddeleine
Copy link
Contributor

@maddeleine maddeleine commented Feb 22, 2025

Release Summary:

Resolved issues:

N/A

Description of changes:

Previously, when using s2n-tls as a TLS provider and operating as a server, we were emitting the server_name after a call to s2n_negotiate. Essentially we would read the Client Hello, generate 1-RTT keys, finish the call to s2n_negotiate and only then try to emit the server name.
Technically the server name can be emitted earlier, in the same place as where we get the 1-RTT keys. So that's what this PR does.

We historically emitted the server name in the place where we get the 1-RTT keys, only moving it later in this PR: #1238. I have no idea why we made that change. I know that s2n-tls didn't always get the 1-RTT keys as early as possible, so maybe originally 1-RTT was triggered later?

Call-outs:

I'm removing the emitted_server_name variable. That seems to be only useful if you are attempting to get the server name multiple times per handshake(we call s2n_negotiate multiple times per handshake.) The callback that provides the 1-RTT keys only triggers once.

Testing:

You can basically just see in the snapshot tests that now we're emitting the server name earlier.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@maddeleine maddeleine requested a review from camshaft February 24, 2025 22:31
Copy link
Contributor

@camshaft camshaft left a comment

Choose a reason for hiding this comment

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

Looks great!

@camshaft camshaft merged commit 8e7f14a into main Feb 27, 2025
128 of 129 checks passed
@camshaft camshaft deleted the server_name branch February 27, 2025 15:55
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.

2 participants