Skip to content

bug: HTTP2 protocol not working when ApisixUpstream scheme is set to https #13002

@singhajitk

Description

@singhajitk

Issue Description

HTTP2 protocol is not working when ApisixUpstream spec scheme is set to https. The upstream connection does not utilize HTTP2 even though the backend service supports it.

Current Behavior

  • ApisixUpstream is configured with scheme: https
  • HTTP2 protocol is not being used for upstream connections
  • Traffic defaults to HTTP/1.1 instead of HTTP2
  • No HTTP2 negotiation occurs despite backend service supporting HTTP2

Expected Behavior

When scheme: https is configured in ApisixUpstream, APISIX should automatically negotiate and use HTTP2 protocol for upstream connections if the backend service supports it via ALPN (Application-Layer Protocol Negotiation).

Error Logs

  • No specific errors

Steps to Reproduce

  1. Create an ApisixUpstream resource with scheme: https
  2. Configure a backend service that supports HTTP2 over TLS
  3. Send requests through APISIX to the upstream
  4. Observe protocol being used (HTTP/1.1 instead of HTTP2)

Configuration Example

apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
  name: example-apisixupstream
spec:
  scheme: https
  discovery:
    type: kubernetes
    serviceName: namespace/service-name:http
  retries: 0
  timeout:
    connect: 150s
    send: 150s
    read: 150s

Environment

  • APISIX version (run apisix version): 3.13.0
  • Operating system (run uname -a): Linux apisix-data-plane-567765b759-6np8s 6.8.0-87-generic doc: why do users need apisix? what problem can apisix solve? #88~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 14:03:14 UTC 2 x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V): nginx version: openresty/1.27.1.2 built with OpenSSL 3.4.1 11 Feb 2025
  • etcd version, if relevant (run curl [http://127.0.0.1:9090/v1/server_info):](http://127.0.0.1:9090/v1/server_info%60):) 3.6.0
  • APISIX Dashboard version, if relevant: 3.0.1
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version): 3.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions