Networking
VERIFIED FIXES

HAProxy returns HTTP/2 GOAWAY to clients after enabling an ACL using ssl_fc variables

Environment

Environment

HAProxy 2.4 fronting web services with HTTP/2 on the frontend and HTTP/1.1 backends. A recent config added a tcp-request content ACL that references ssl_fc_sni and ssl_fc_protocol to route traffic based on TLS attributes. Issue reproduces when many concurrent HTTP/2 streams are opened from browsers.

Symptoms

Symptoms

Browsers report broken HTTP/2 streams and intermittent 502/GOAWAY frames. HAProxy logs show abrupt connection termination with 'server sent GOAWAY' events. Short single-stream requests often succeed; long-lived or multiplexed streams fail more frequently.

Observations

Observations

Config uses tcp-request content rules with ssl_fc_* variables on an h2-enabled frontend. tcp-request content runs in TCP mode and may trigger early connection handling before HTTP/2 layer initialization. When ACLs reference SSL vars too early, HAProxy resets or re-negotiates, causing GOAWAY. Disabling the ACL stops GOAWAYs. No backend errors; problem localized to frontend behavior.

Already attempted

Already attempted

Moved the ACL into http-request rules on a separate frontend (requires terminating TLS earlier) — partially mitigated but broke TLS passthrough cases. Upgrading to HAProxy 2.6 not currently possible due to distro constraints.

Question

Question

How to evaluate and fix the GOAWAYs while keeping SNI-based routing policy that sometimes needs tcp-level checks? Are there safe config changes in 2.4 to avoid breaking HTTP/2 multiplexing?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
feliciafix Answer
user
Posted 1mo ago • 0 confirmations

The quickest safe test is to remove the tcp-request content ACL referencing ssl_fc_* — if GOAWAYs stop, the ACL is the culprit. Fix by moving SNI/TLS checks into the HTTP layer (http-request or use_backend with { req.ssl_sni }) on a TLS-terminating frontend, or perform SNI routing at bind-time so you don't alter a connection mid-handshake. For passthrough needs, avoid tcp-request content that touches ssl_fc_* while using HTTP/2. Verify by running an h2 load test and watch if GOAWAYs disappear. Roll back the config if client regressions occur.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

tcp-request content ACL referencing ssl_fc_* executed too early in connection lifecycle, disrupting HTTP/2 connection setup 90%
HTTP/2 multiplexing sensitive to mid-connection routing changes; ACL actions cause connection resets/GOAWAY 70%
Bug or regression in HAProxy 2.4 handling of ssl_fc_* in TCP mode with h2 frontend 25%

Summary

Using tcp-request content ACLs that reference ssl_fc_* on an HTTP/2-terminating frontend can run before HAProxy has fully set up HTTP/2 connection state, causing mid-handshake handling that leads to stream termination and GOAWAY. The safer approach is to perform SNI/SSL-based routing at the 'bind' or use dedicated frontends that terminate TLS early so http-request ACLs operate in the HTTP layer. Alternatively, move SNI checks into ssl_fc_sni() in frontend and route to backend using use_backend with appropriate conditions. Avoid tcp-request content for variables that depend on post-TLS/HTTP setup when using HTTP/2 multiplexing.

Suggested Fixes

Diagnostic step 1
Temporarily revert the tcp-request content ACL to confirm it is the trigger (already observed).
Diagnostic step 2
Move SNI-based routing to use use_backend ... if { req.ssl_sni -i example.com } or, if terminating TLS in HAProxy, use http-request rules instead of tcp-request content so checks run in HTTP layer.
Diagnostic step 3
If passthrough is required, perform SNI inspection at bind time (req.ssl_sni()) and route without altering established connections.

Continue troubleshooting

Matched from the title, description and tags