Skip to content

[SignalR] Avoid Http2 when negotiate auth is used - #45985

Merged
BrennanConroy merged 4 commits into
mainfrom
brecon/http2negotiate
Jan 10, 2023
Merged

BrennanConroy merged 4 commits into
mainfrom
brecon/http2negotiate

Conversation

@BrennanConroy

Copy link
Copy Markdown
Member

Fixes #45371

private bool IsSupportedProtocol => HttpProtocol.IsHttp11(Request.Protocol) || HttpProtocol.IsHttp10(Request.Protocol);

@BrennanConroy BrennanConroy added area-signalr Includes: SignalR clients and servers feature-client-net Related to the SignalR .NET client labels Jan 10, 2023
@Tratcher
Tratcher requested a review from MihaZupan January 10, 2023 17:16

@halter73 halter73 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's nice not having to set HttpRequestMessage.Version everywhere.

{
o.ConfigureEndpointDefaults(o2 =>
{
o2.Protocols = Server.Kestrel.Core.HttpProtocols.Http1AndHttp2;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What if the client is configured to allow HTTP/2 but not the server?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That doesn't affect this change, since we aren't even trying HTTP/2 for negotiate auth now.
But if you just want general behavior, the client will retry with HTTP/1.1 (except for these types of edge cases).

@BrennanConroy

Copy link
Copy Markdown
Member Author

It's nice not having to set HttpRequestMessage.Version everywhere.

Yeah, not sure why we didn't do it that way to start with

@BrennanConroy
BrennanConroy merged commit a8f527d into main Jan 10, 2023
@BrennanConroy
BrennanConroy deleted the brecon/http2negotiate branch January 10, 2023 23:57
@ghost ghost added this to the 8.0-preview1 milestone Jan 10, 2023
@BrennanConroy

Copy link
Copy Markdown
Member Author

/backport to release/7.0

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-signalr Includes: SignalR clients and servers feature-client-net Related to the SignalR .NET client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SignalR Client Windows Authentication returning 401Unautorized (update 6.0.11 -> 7.0.0)

3 participants