You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP/2 requests responding with GOAWAY error HTTP_1_1_REQUIRED are retried with HTTP/2 #22923
I'm running a reverse proxy server that is configured to advertise both h2 and http/1.1 in ALPN - some endpoints support HTTP/2 and others do not. Those that do not support HTTP/2 send GOAWAY with HTTP_1_1_REQUIRED as the error code.
When sending a request using cURL, on retry curl advertises h2 in ALPN, causing the server to renegotiate HTTP/2.
At least in my case curl CURLE_RECV_ERROR causes the retry, so it doesn't interpret it as a downgrade. This may have something to do with the way I'm testing, I'm using a python server to serve the http1.1 required
Well I'm not sure what I did wrong here if anything. Wireshark shows curl responds to the GOAWAY with a GOAWAY of its own and a close notify, then the server sends FIN/ACK. Maybe someone else can test with a proper server.
Some background here: HTTP_1_1_REQUIRED is an unusual error code in a GOAWAY. The logic is as follows:
if the server does not want to talk HTTP/2 at all, it should never negotiate it in the ALPN.
if the server has a mix of resources, some allow HTTP/2, some do not, it is expected to RST a stream to the latter resources with HTTP_1_1_REQUIRED, leaving the connection alive for the supported resources.
We had tests for this on stream RST, but not for the GOAWAY and I have no test server that can do this. So, if you can in any way influence the developer of your server, tell them that they are in strange country and might encounter other clients that are not expecting this.
That developer would be myself - it's my first time digging into HTTP/2 framing and this was my solution for handling the scenario where the server has a mix of HTTP/2 and HTTP/1.1 resources. The additional context and explanation is very much appreciated, thank you!
Activity
jay commentedon Sep 12, 2026
Confirmed using master 8.22.1-DEV, 8.4.0 and 8.5.0. It looks like this is the code that makes it retry on HTTP_1_1_REQUIRED:
curl/lib/multi.c
Lines 2063 to 2092 in 0134682
ALPN selection:
curl/lib/vtls/vtls.c
Lines 98 to 122 in 0134682
I put some printfs there and
wantedon all tries contains CURL_HTTP_V2x and CURL_HTTP_V1x, andpreferredis 0.jay commentedon Sep 12, 2026
At least in my case curl CURLE_RECV_ERROR causes the retry, so it doesn't interpret it as a downgrade. This may have something to do with the way I'm testing, I'm using a python server to serve the http1.1 required
curl/lib/multi.c
Lines 2045 to 2092 in 0134682
jay commentedon Sep 13, 2026
Well I'm not sure what I did wrong here if anything. Wireshark shows curl responds to the GOAWAY with a GOAWAY of its own and a close notify, then the server sends FIN/ACK. Maybe someone else can test with a proper server.
icing commentedon Sep 14, 2026
I think we never implemented seeing
HTTP_1_1_REQUIREDin aGOAWAY.icing commentedon Sep 14, 2026
Could you try #22946 and report if this fixes the problem? Thanks!
drmathias commentedon Sep 15, 2026
It does appear to fix the problem. Thanks - you're a legend!
icing commentedon Sep 15, 2026
Some background here:
HTTP_1_1_REQUIREDis an unusual error code in aGOAWAY. The logic is as follows:ALPN.RSTa stream to the latter resources withHTTP_1_1_REQUIRED, leaving the connection alive for the supported resources.We had tests for this on stream
RST, but not for theGOAWAYand I have no test server that can do this. So, if you can in any way influence the developer of your server, tell them that they are in strange country and might encounter other clients that are not expecting this.drmathias commentedon Sep 15, 2026
That developer would be myself - it's my first time digging into HTTP/2 framing and this was my solution for handling the scenario where the server has a mix of HTTP/2 and HTTP/1.1 resources. The additional context and explanation is very much appreciated, thank you!
http2: update a refused stream's error after GOAWAY
http2: update a refused stream's error after GOAWAY