Skip to content

THREESCALE-17104 Introduce APICAST_HTTP2 env var to toggle http2 - #1617

Open
tkan145 wants to merge 1 commit into
3scale:masterfrom
tkan145:toggle-http2
Open

tkan145 wants to merge 1 commit into
3scale:masterfrom
tkan145:toggle-http2

Conversation

@tkan145

@tkan145 tkan145 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What

https://redhat.atlassian.net/browse/THREESCALE-17104

Verification steps

  • Checkout this branch
  • Build new APIcast image
make runtime-image IMAGE_NAME=apicast-test
  • Get into dev-env
cd dev-environments/listen-tls
make certs
  • Start the gateway
make gateway IMAGE_NAME=apicast-test
  • Send curl request
curl --http2 --resolve example.com:8443:127.0.0.1 -v --cacert cert/rootCA.pem "https://example.com:8443/?user_key=123"

You should see http2 request

* Established connection to example.com (127.0.0.1 port 8443) from 127.0.0.1 port 36302
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://example.com:8443/?user_key=123
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: example.com:8443]
* [HTTP/2] [1] [:path: /?user_key=123]
* [HTTP/2] [1] [user-agent: curl/8.18.0]
* [HTTP/2] [1] [accept: */*]
> GET /?user_key=123 HTTP/2
> Host: example.com:8443
> User-Agent: curl/8.18.0
> Accept: */*
>
* Request completely sent off
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/2 200
< server: openresty
< date: Fri, 04 Dec 2026 03:06:57 GMT
< content-type: application/json
< content-length: 296
  • Stop the gateway
CRTL-C
  • Edit docker-compose.yml as follow
diff --git a/dev-environments/listen-tls/docker-compose.yml b/dev-environments/listen-tls/docker-compose.yml
index 476ca81f..a340f895 100644
--- a/dev-environments/listen-tls/docker-compose.yml
+++ b/dev-environments/listen-tls/docker-compose.yml
@@ -16,6 +16,7 @@ services:
       THREESCALE_DEPLOYMENT_ENV: staging
       APICAST_CONFIGURATION_LOADER: lazy
       APICAST_WORKERS: 1
+      APICAST_HTTP2: false
       APICAST_LOG_LEVEL: debug
       APICAST_CONFIGURATION_CACHE: "0"
     expose:
  • Start the gateway again
make gateway IMAGE_NAME=apicast-test
  • Resend the request
curl --http2 --resolve example.com:8443:127.0.0.1 -v --cacert cert/rootCA.pem "https://example.com:8443/?user_key=123"

You should see http/1.1 now

* using HTTP/1.x
> GET /?user_key=123 HTTP/1.1
> Host: example.com:8443
> User-Agent: curl/8.18.0
> Accept: */*
>
* Request completely sent off
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/1.1 200 OK
< Date: Fri, 04 Dec 2026 03:08:55 GMT
< Content-Type: application/json
< Content-Length: 296
< Connection: keep-alive

@tkan145
tkan145 requested review from a team as code owners December 3, 2026 05:20
NOTE: set APICAST_WORKERS in test due to lua-http use blocking
socket and requires at least 2 workers to avoid connection timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant