Skip to content

HTTP/2 requests responding with GOAWAY error HTTP_1_1_REQUIRED are retried with HTTP/2 #22923

Description

@drmathias

I did this

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.

=> Send header, 80 bytes (0x50)
0000: GET / HTTP/2
000e: Host: pwrti8go.jvln.test
0028: User-Agent: curl/8.22.0
0041: Accept: /
004e:

  • Request completely sent off
    <= Recv SSL data, 5 bytes (0x5)
    0000: ....!
    <= Recv SSL data, 5 bytes (0x5)
    0000: ....)
  • received GOAWAY, error=13, last_stream=0
  • HTTP/2 stream 1 refused by server, try again on a new connection
    => Send SSL data, 5 bytes (0x5)
    0000: ....!
  • REFUSED_STREAM, retrying a fresh connect
  • Connection died, retrying a fresh connect (retry count: 4)
  • shutting down connection #...
  • Issue another request to this URL: 'https://pwrti8go.jvln.test/'
  • Hostname pwrti8go.jvln.test was found in DNS cache
  • Host pwrti8go.jvln.test:443 was resolved.
  • IPv6: (none)
  • IPv4: 127.0.0.1
  • Trying 127.0.0.1:443...
  • SSL reusing session with ALPN '-'
  • SSL verify result: 0
  • ALPN: curl offers h2,http/1.

I expected the following

On retry, only http/1.1 should be advertised by curl

curl/libcurl version

curl 8.22.0 (x86_64-apple-darwin25.2.0) libcurl/8.22.0 OpenSSL/3.6.4 zlib/1.2.12 brotli/1.2.0 zstd/1.5.7 AppleIDN libpsl/0.23.3 libssh2/1.11.1 nghttp2/1.70.0 ngtcp2/1.25.0 nghttp3/1.18.0 mit-krb5/1.7-prerelease OpenLDAP/2.4.28/Apple
Release-Date: 2026-09-02

operating system

Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:34 PST 2025; root:xnu-12377.61.12~1/RELEASE_X86_64 x86_64

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions