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

Configure ALPN for callback scenarios #34242

Merged
merged 2 commits into from
Jul 18, 2021
Merged

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented Jul 9, 2021

Fixes #31303 by stashing HttpProtocols on TlsHandshakeCallbackOptions just like we did for HttpsConnectionAdapterOptions. If either of the callbacks don't supply ALPN settings then we will. ApplicationProtocols can be set to an empty list to disable ALPN.

Is this too magical?

Is it breaking for people that were using ServerOptionsSelectionCallback and suddenly HTTP/2 starts working?

@Tratcher Tratcher requested a review from halter73 July 9, 2021 22:31
@Tratcher Tratcher self-assigned this Jul 9, 2021
listenOptions.UseHttps((_, _, _, _) =>
ValueTask.FromResult(new SslServerAuthenticationOptions()
{
ServerCertificate = _x509Certificate2,
Copy link
Member

@halter73 halter73 Jul 10, 2021

Choose a reason for hiding this comment

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

Can we add a test case confirming that adding

Suggested change
ServerCertificate = _x509Certificate2,
ServerCertificate = _x509Certificate2,
ApplicationProtocols = new(),

disables ALPN? Assuming it does ofc.

Copy link
Member Author

@Tratcher Tratcher Jul 10, 2021

Choose a reason for hiding this comment

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

It worked on Windows but fails on Ubuntu 😢. I'll file a runtime bug for that. dotnet/runtime#55447

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in rc1 (main), dotnet/runtime#55772. Waiting for a runtime update.

@Tratcher Tratcher added this to the 6.0-rc1 milestone Jul 16, 2021
@halter73 halter73 changed the title Configure APLN for callback scenarios Configure ALPN for callback scenarios Jul 16, 2021
@Tratcher
Copy link
Member Author

Tratcher commented Jul 18, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Tratcher Tratcher enabled auto-merge (squash) July 18, 2021 00:13
@Tratcher Tratcher merged commit 19f1321 into dotnet:main Jul 18, 2021
@Tratcher Tratcher deleted the tratcher/alpn branch July 18, 2021 01:40
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make ALPN configuration easier for use with TlsHandshakeCallbackOptions
3 participants