-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
WebSockets downgrade to 1.1 on network failure during TLS handshake #75399
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsManaged WebSocket will attempt to downgrade to HTTP/1.1 if we failed to establish HTTP/2 and the version policy permits. The logic currently sets runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs Lines 94 to 96 in cb1343d
This is wrong. That failure could be caused by the network and has nothing to do with whether the server supports HTTP/2. The current downgrade test does not exercise this. It connects to an
|
Triage: This may be by design (due to implementation), and if it is not, then the impact on customers is super-small - we will establish 1.1 connection in more cases than we should (when H/2 connection failed due to network error). |
Tagging subscribers to this area: @dotnet/ncl |
Managed WebSocket will attempt to downgrade to HTTP/1.1 if we failed to establish HTTP/2 and the version policy permits.
The logic currently sets
HTTP2_ENABLED
exception data if we fail to establish TLS:runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs
Lines 94 to 96 in cb1343d
This is weird. That failure could be caused by the network and has nothing to do with whether the server supports HTTP/2.
As a result, we will end up retrying on HTTP/1.1 even though we normally wouldn't (and SocketsHttpHandler wouldn't either).
We should be able to just delete this check entirely - actual ALPN issues will be caught later in
HttpConnectionPool
when we attempt to retry an HTTP/2-only request on the downgraded 1.1 connection.The current downgrade tests don't exercise this as they are connecting to an
http
endpoint so we never even attempt HTTP/2.The text was updated successfully, but these errors were encountered: