Announcing HAProxy 3.5

HAProxy 3.5 strengthens HTTP security with stricter defaults and configurable hardening profiles. These controls help protect applications when components in the traffic path interpret the same HTTP message differently. You can adjust profile checks through the HAProxy Runtime API and select specific parser exceptions for legacy applications.

Native decompression lets HAProxy instances exchange compressed traffic across clouds and data centers, helping reduce bandwidth use. The included SLZ keeps the memory overhead of compression low, even with many concurrent streams; additionally, version 1.4 enables faster compression and higher ratios. Live event streams get automatic low-latency forwarding and, when enabled, more efficient compression of small updates. An experimental mode reduces contention in connection handling on servers with many CPU cores.

These changes extend HAProxy's legendary performance, reliability, and security, building on the multicore improvements in 3.3 and the dynamic backends and HTTP glitch detection introduced in 3.4.

What is HAProxy?

HAProxy is the world's fastest and most widely used software load balancer. It provides high availability, load balancing, and SSL/TLS termination for TCP, QUIC, and HTTP-based applications.

HAProxy is the open source core that powers HAProxy One, the world's fastest application delivery and security platform.

New in HAProxy 3.5

  • Performance: Native decompression supports compressed transfers across clouds and data centers; SLZ 1.4 enables faster compression and higher ratios. Experimental per-thread-group file-descriptor tables reduce contention on servers with many CPU cores. Low-latency handling is now automatic for API/AI gateways using SSE; earlier versions required option http-no-delay; stream-oriented compression can also reduce bandwidth use when enabled. Scheduling and connection-cleanup improvements reduce processing overhead; smaller, customizable builds support resource-constrained deployments. Lua scripts can reuse one HTTP client across several requests.

  • Flexibility: Named server profiles simplify the reuse of settings across backends; filter controls separate configuration, enablement, and processing order. Automatic HTTP 103 Early Hints tell browsers which resources they can fetch while the application prepares a page. One rule can populate several variables from a map, reducing repeated configuration. Routing-time hooks can consult an external policy service, and Lua events let integrations react to backend changes.

  • Reliability: HAProxy retries truncated DNS responses over TCP to retrieve the complete answer. Shared trailer validation applies consistent checks across protocols; message-end fixes address unusual upgrade and filter combinations. Cache improvements address variant selection and freshness, alongside corrections to redirect handling and protocol stability.

  • Security and TLS: HTTP hardening profiles let you apply different checks to client-side and server-side traffic. Select specific HTTP-violation exceptions and change hardening checks through the HAProxy Runtime API. Automatic filesystem isolation limits filesystem access where startup conditions allow it. Request-time client-certificate checks expose revocation status for access rules to act on. A dedicated HMAC JWT verifier separates shared-secret verification from public-key verification. Startup diagnostics flag access rules whose URL matching may differ from the application's interpretation. Encrypted Client Hello support extended to AWS-LC. HAProxy limits TLS 1.3 KeyUpdate messages and outgoing QUIC Stateless Reset packets. It also disables kernel TLS offload with OpenSSL versions affected by a known stream-corruption bug.

  • Observability: Master and worker identifiers tie trace logs and metrics to a specific process, while named logger groups control where selected events are stored. Embedded HAProxy symbols improve backtraces in stripped binaries, and hardening results enrich configured logs. The new haload load generator enables testing HTTP/1, HTTP/2, and HTTP/3 traffic, with request-rate controls and latency reporting. Curve-name translation improves readability in TLS logs and rules.

  • Management: Scripts can batch additions and removals of servers and backends. The purge commands handle cleanup in the background without requiring CLI completion-status checks. CLI wait and show events commands are now usable from non-interactive scripts. A global kill switch permits HAProxy to disable HTTP/2 on all frontends without requiring changes on all listeners, and can be applied via standard configuration rollouts. You can rename servers, reset individual counters, inspect connection ownership, and choose which defaults stay in memory.

The next version of HAProxy Enterprise will incorporate these features.

Performance

Following 3.3's multicore improvements and 3.4's buffer and scheduler work, HAProxy 3.5 advances the load balancer's legendary performance.

Native decompression lets HAProxy instances exchange compressed traffic between sites, while SLZ 1.4 improves compression speed and ratios. An experimental file-descriptor mode reduces contention on large multicore servers.

API/AI gateways using SSE get automatic low-latency forwarding, plus efficient compression when enabled. Load-balancing improvements make better use of weighted server pools, while scheduler changes reduce the CPU work needed to handle traffic.

HTTP decompression

HAProxy 3.5 adds request and response decompression when built with USE_SLZ. You can now place HAProxy instances as a sidecar at both ends of a connection and send compressed traffic between them. This helps reduce bandwidth use between cloud availability zones or regions.

The included SLZ 1.4 keeps the memory overhead of compression low, even with many concurrent streams, and enables faster compression/decompression and higher compression ratios. These improvements benefit existing compression configurations as well as the new decompression feature.

In the following example, two application components (east and west) each use a local HAProxy sidecar for external communication. The HAProxy sidecars compress and decompress eligible traffic, so the applications need no compression logic. Requests travel east to west; responses follow the reverse path. The example uses standard gzip encoding, so HAProxy can also exchange compressed HTTP with other gzip-capable components.

east-haproxy
frontend myapp
mode http
bind :80
default_backend myapp
backend myapp
mode http
# Compress requests sent to west-haproxy.
filter-config http-comp-req enabled
compression algo-req gzip
compression type-req application/json text/plain
# Decompress responses received from west-haproxy.
filter-config decomp-res enabled
decompression mode-res auto
decompression algo-res gzip
server west-haproxy 172.16.0.10:80 check
west-haproxy
frontend myapp
mode http
bind 172.16.0.10:80
# Decompress requests received from east-haproxy.
filter-config decomp-req enabled
decompression mode-req auto
decompression algo-req gzip
# Compress responses sent to east-haproxy.
filter-config http-comp-res enabled
compression algo-res gzip
compression type-res text/css text/html text/plain application/javascript application/json
default_backend servers
backend servers
mode http
server app 192.0.2.10:8080 check

The request settings use the -req suffix; the response settings use -res. In HTTP mode, auto selects decompression from the message's Content-Encoding header.

Decompression also supports TCP streams, with uslz-auto available to detect the supported compression format.

Connection scaling on large servers

HAProxy 3.5 adds an experimental mode that gives each thread group its own file-descriptor table. This reduces kernel-side contention when many CPU cores open and close connections, helping connection-heavy workloads make better use of large servers.

To enable it, set tune.fd.tables to per-thread-group:

global
expose-experimental-directives
tune.fd.tables per-thread-group

If the configuration is started on a 64-core CPU made of 8 core complexes of 8 cores / 16 threads each, then there will be 8 groups of 16 threads each. Each group will use a separate table shared only between the threads of the same group, instead of sharing one table across the process. The default remains shared.

Live event streams

HAProxy 3.5 automatically uses low-latency forwarding for responses with a Content-Type of text/event-stream. This helps applications such as AI chat services send updates to clients as they are produced, without an explicit option http-no-delay setting.

Compression also works more efficiently with small events. When built with SLZ, HAProxy keeps compression history between flushes, so repeated text can be compressed across successive events.

In the following example, we enable gzip compression for event-stream responses when the client advertises gzip support:

backend event_streams
mode http
compression algo-res gzip
compression type-res text/event-stream
server events 192.0.2.20:8080 check

The compression history is enabled by default and controlled by tune.comp.res.ring.

Other performance improvements

Scheduling and idle-connection changes reduce CPU overhead, while server-list and ID-allocation improvements speed up changes to large configurations. IPv6 addresses in ACLs and maps are parsed before DNS lookups, shortening startup for large address lists.

The random(N) algorithm now draws distinct server candidates for each selection, improving fairness and adherence to weights in uneven pools. Consistent-hash lookups also do less work.

QUIC handshakes use native HKDF APIs where the TLS library supports them. Logging avoids repeated timestamp work and reduces CBOR-encoding overhead. For smaller deployments, optional build settings and the tiny target let you leave out features you don't need. A Lua HTTP client can send several requests without being recreated for each one. 

Flexibility

HAProxy 3.5 extends HAProxy’s incredible flexibility, building on the dynamic backends introduced in 3.4.

You can define common server settings once, then choose which servers inherit them. Filter controls let you select where a feature runs and order steps such as decompression, caching, and tracing.

Routing hooks can ask an external service to help choose a backend. One action can fill several variables from a map. Lua events let a script update an inventory when backends appear or disappear, rather than scan the HAProxy Runtime API at regular intervals.

Named default-server lines 

HAProxy supports many optional arguments when defining servers in a backend. Moving arguments that are common to all of your servers to a default-server line helps reduce repetition. In version 3.5, you can create named default-server lines and assign them by name to servers. That means servers in a backend can use different default settings.

In the following example, we place two named default-server directives into a backend section. We indicate with the from argument which default-server each server should use.

backend servers
default-server name short-health-check check inter 3s
default-server name long-health-check check inter 30s
server web1 172.16.0.12:8080 from srv:short-health-check
server web2 172.16.0.13:8080 from srv:long-health-check

The default-server doesn't need to live in the same backend as the server inheriting it. When it's defined in a different backend, prefix the from value with the name of the backend containing the default settings. You can even point from to another server line to inherit the settings from that server, even when that server lives in another backend. 

When adding servers dynamically through the HAProxy Runtime API, you can similarly set which defaults to use per server. Use the new show default-server command to get the names of default-server directives so you can apply them.

Early Hints (HTTP 103)

You can now configure a cache section in HAProxy to return an HTTP 103 Early Hints response to the browser. This response tells the browser that, while it waits for the server to return a fresh copy of the web page, there are other resources it could start to fetch or that it can preconnect to a certain host, such as a CDN, where the resources it needs are. These hints are based on Link headers present in the cached response. In earlier HAProxy versions, you could construct an HTTP 103 response yourself by using http-request early-hint. Having HAProxy construct it for you is a simpler option.

In the cache section, set the early-hints directive to on. You can also set it to only, which means use the cache solely for this purpose and don't cache responses. You can also set the ratio argument, which determines the percentage of the cache's space to reserve for Link headers; it defaults to 25.

cache mycache
early-hints on ratio 30
total-max-size 4
max-object-size 10000
max-age 240
process-vary on
max-secondary-entries 12

A new syntax for filters

In previous versions, to use one of HAProxy's optional features like caching, compression, and traffic shaping, you'd add the applicable filter directive to your configuration. Filters serve two purposes: they enable the feature and, in some cases, declare configuration settings that tune the filter's behavior. For instance, the bwlim-in filter supports four arguments related to setting a bandwidth limit. This marriage of enablement and configuration on the same line meant you'd have to duplicate the arguments everywhere you wanted to enable the filter.

HAProxy 3.5 separates filter configuration from enablement by introducing distinct directives, filter-config and filter-enable. This means you can put the configuration settings into a named defaults section and then any frontend or backend that inherits those settings can select the filters to use with filter-enable. Every filter gained this new syntax, although the old way still exists.

In this example, we set filter-config in the defaults section to configure the storage of responses in the cache. There are no extra settings, other than giving the filter configuration an ID. The value comes from our new ability to enable this filter where we need it. The backend enables it with filter-enable.

cache mycache
total-max-size 4
max-object-size 10000
max-age 240
process-vary on
max-secondary-entries 12
defaults mydefaults
filter-config cache-store id mycache
backend myapp from mydefaults
filter-enable cache-store
http-request cache-use mycache
http-response cache-store mycache
...

You can also enable a filter immediately with the filter-config directive's enabled argument, if you prefer to enable filters by default. Then, use filter-disable to turn them off.

The new filter-sequence directive lets you order filters independently of where they are declared. Request and response sequences are separate; the global sequence controls lifecycle operations.

In this diagnostic example, we place one trace filter before response compression and another after it:

backend filtered_app
mode http
filter-config trace id before enabled
filter-config http-comp-res enabled
filter-config trace id after enabled
filter-sequence response trace/before:before(http-comp-res)
filter-sequence response trace/after:after(http-comp-res)
compression algo-res gzip
compression type-res text/html text/plain
server app 192.0.2.10:8080 check

The before and after constraints apply to the response sequence. You can inspect the resulting order with show filter instances filtered_app response on the HAProxy Runtime API.

Other flexibility improvements

One set-vars-from-map action can set several values at once, so you don't need a separate rule for each value. Routing hooks can ask an external service for backend-selection data, while Lua events let scripts track backends as they come and go. Rules can also sort bytes or translate characters, and decompression settings can enable the required filters for you.

Reliability

Building on 3.4's reusable health checks and HTTP glitch detection, HAProxy 3.5 reinforces its rock-solid reliability.

DNS lookups retry over TCP when a UDP answer is truncated, helping service discovery retrieve the complete set of addresses. Shared trailer validation gives HTTP/1 and FastCGI the same checks as HTTP/2 and HTTP/3.

Message-completion changes improve handling around upgrades and filters. Cache fixes also make response-variant selection and freshness more predictable.

DNS retries with TCP

HAProxy now switches to querying your DNS nameservers over TCP if it gets a truncated response when using UDP. You're most likely to encounter this if you populate backend servers through DNS-based service discovery, which, depending on the number of IP addresses that answer for a hostname, can be a large DNS response.

Suppose that in your HAProxy configuration, you set up DNS-based service discovery by indicating your DNS nameserver in a resolvers section and then, in the backend, you use the server-template directive to populate servers for each of the IP addresses that HAProxy gets from resolving the hostname, web.example.local.

resolvers mynameservers
nameserver ns1 172.16.0.20:53
# Maximum size of a DNS answer allowed, in bytes
accepted_payload_size 512
hold valid 10s
hold other 30s
hold refused 30s
hold nx 30s
hold timeout 30s
hold obsolete 30s
resolve_retries 3
timeout retry 1s
timeout resolve 5s
backend app1
server-template web 30 web.example.local:8080 check resolvers mynameservers init-addr none

Your DNS server answers with 30 IP addresses for the hostname web.example.local.

$ORIGIN example.local.
web IN A 172.16.0.10
web IN A 172.16.0.11
web IN A 172.16.0.12
web IN A 172.16.0.13
# continued …

The response exceeds the 512 bytes limit set in the resolvers section, so the DNS server truncates the response. HAProxy tries again over TCP. Below, we show the log from the CoreDNS server, confirming an initial UDP request, which was truncated (indicated by a tc code), followed by a TCP request. The TCP request allows up to 65,535 bytes.

dns1-1 | [INFO] 172.16.0.10:52695 - 31922 "A IN web.example.local. udp 46 false 512" NOERROR qr,aa,tc,rd 1115 0.000568907s
dns1-1 | [INFO] 172.16.0.10:45878 - 1 "A IN web.example.local. tcp 46 false 65535" NOERROR qr,aa,rd 1115 0.000108232s

If you don't want this behavior, you can force HAProxy to use only UDP or TCP. Prefix the nameserver's address with the protocol, as shown in this snippet where we force TCP.

resolvers mynameservers
nameserver ns1 tcp@172.16.0.20:53

Other reliability improvements

HAProxy now applies the same trailer checks across protocols and handles more edge cases around message endings, upgrades, and filters. Cache fixes address which response variant is served and how long it stays fresh; redirects also get more consistent URL handling. The wait-for-body action gains no-fail, which lets processing continue with the body received so far when its wait timer expires. Some fixes also reach older maintained branches, so check the notes for the version you run.

Security and TLS

Following 3.3's Encrypted Client Hello and 3.4's ACME enhancements, HAProxy 3.5 extends the proxy's class-leading TLS processing and automation.

HTTP hardening profiles control how HAProxy handles unusual messages before another component interprets them differently. You can choose specific parser exceptions and adjust hardening checks through the HAProxy Runtime API.

Filesystem isolation limits the files a process can access after startup. Request-time OCSP checks expose client-certificate revocation status, while dedicated JWT verification interfaces separate shared-secret and public-key verification.

HTTP hardening profiles

HAProxy 3.5 introduces http-hardening sections to control how it handles unusual HTTP messages. Some constructs are valid but discouraged because they can be interpreted differently by products in the same traffic path. Blocking these constructs outright might have a significant impact on legacy applications; instead, HAProxy 3.5 allows you to control behavior when handling such constructs. HTTP hardening profiles let you reject or sanitize unusual HTTP messages before they reach another component.

The built-in untrusted profile applies to connections from public IP addresses, and defaults to conservative checks. Local or private client addresses, and server connections, use trusted by default. The stricter basic-web profile is intended for sites serving browsers.

You can inherit a profile and change individual checks. In the following example, we create a web-app profile that inherits the stricter checks of the basic-web profile but allows X- headers from public IP addresses:

http-hardening web-app from basic-web
delete-unregistered-header-fields off
frontend myfrontend
mode http
bind :80 http-hardening web-app
default_backend mybackend
backend mybackend
mode http
server s1 172.16.0.10:8080 check

The bind line applies the custom profile to client traffic. The backend keeps the default trusted profile.

You can also change a profile through the HAProxy Runtime API. With an administrative socket at /run/haproxy/admin.sock, this command enables duplicate-Host rejection immediately:

echo 'set http-hardening web-app reject-duplicate-host-header on' \
| socat - /run/haproxy/admin.sock

Select specific HTTP exceptions

The new acceptable-http-request-violations and acceptable-http-response-violations settings let you choose which parser exceptions an application can accept. This gives you finer control when connecting to a legacy application.

In the following example, we allow responses containing certain invalid characters in a header name, which might be returned by a non-compliant application:

global
acceptable-http-response-violations non-token-in-header-name
backend legacy
mode http
option accept-unsafe-violations-in-http-response
server app 192.0.2.40:8080 check

The global setting selects the exception. The backend option enables it for responses from that backend, while other violations remain checked.

Safer request filtering

HAProxy 3.5 adds startup notices for blocking rules that might miss alternative URL spellings leading to the same application resource. For example, this rule tries to block external access to /admin/:

acl admin_path path_beg /admin/
acl internal_network src 10.0.0.0/8
http-request deny if admin_path !internal_network

With the default diagnostic settings, HAProxy identifies this blocking rule in a startup notice and asks you to review it. An application might decode /%61dmin/ as /admin/, while the literal prefix test above does not match. The notice identifies the potential problem; it does not change request handling.

For a dedicated admin frontend, this allow-list permits only requests whose path starts with /admin/ and whose source belongs to 10.0.0.0/8. It deliberately denies non-admin paths too.

acl admin_path path_beg /admin/
acl internal_network src 10.0.0.0/8
http-request deny unless admin_path internal_network

Every other request is denied, including requests for non-admin paths. This corrected rule does not trigger the unreliable-rule startup notice.

Filesystem isolation by default

HAProxy 3.5 can automatically enter an empty, read-only filesystem jail at startup. This limits the files the process can access while it handles traffic.

The automatic behavior applies when HAProxy has sufficient privileges (even for unprivileged users), no explicit chroot setting, and set-dumpable is not enabled. You can also request an empty filesystem explicitly:

global
chroot auto

An existing chroot setting continues to define the filesystem root for that deployment, and chroot / can be used to continue to run without a chroot if absolutely necessary (not recommended).

OCSP verification of client certificates

With HAProxy 3.5, you can use the Online Certificate Status Protocol (OCSP) for a new purpose.

Web browsers use OCSP to check if the host's TLS certificate has been revoked. HAProxy supports that scenario with its OCSP stapling feature, which attaches the server certificate's revocation status to the TLS handshake, speeding up the browser's verification process. 

What's new in this version is that you can use OCSP to safeguard mTLS sessions by checking whether a client's certificate has been revoked. With OCSP being the main alternative to traditional certificate revocation lists, it makes sense to use it on the server like this.

The new http-request do-ocsp-request action contacts the certificate's OCSP responder and stores the result in variables. Your access rules then decide which results to accept.

In the following example, we configure the issuer chain and require client certificates. The access rules accept requests only when the check returns good with no checking error:

global
issuers-chain-path /etc/haproxy/issuers
frontend myfrontend
mode http
bind :443 ssl
ssl-f-use crt /etc/haproxy/site.pem ca-file /etc/haproxy/client-ca.pem verify required
http-request do-ocsp-request status-var txn.ocsp_status reason-var txn.ocsp_reason
http-request deny unless { var(txn.ocsp_status) -m str good }
http-request deny unless { var(txn.ocsp_reason) -m int 0 }
default_backend servers

The issuer directory supplies certificates used to verify the OCSP response. The ocsp_check_err_str converter translates a checking error code into readable text for logs.

Dedicated JWT verification

HAProxy 3.5 adds jwt_verify_secret() for JWT signatures that use HMAC and a shared secret. For public-key signatures, jwt_verify_cert() now accepts a public-key file as well as a certificate. The older generic jwt_verify() converter is deprecated because it was possible to use it incorrectly.

In the following example, we accept the RS256 algorithm and verify the signature with a public key:

http-request set-var(txn.jwt_alg) http_auth_bearer,jwt_header_query('$.alg')
http-request deny unless { var(txn.jwt_alg) -m str RS256 }
http-request deny unless { http_auth_bearer,jwt_verify_cert(txn.jwt_alg,"/etc/haproxy/jwt-public.pem") -m int 1 }

A result of 1 means the signature check succeeded. Signature verification works alongside the issuer, audience, and expiration checks in an authentication policy.

Other security and TLS improvements

ECH now works with AWS-LC. Limits on TLS key updates and QUIC stateless resets reduce work spent on excessive messages. Certificate-name checks are stricter, and internal HTTP requests use the configured backend cipher defaults.

Lua certificate events and ACME.challenge_ready() support scripted certificate automation. A Gandi LiveDNS DNS-01 handler is included as an example, giving you a starting point for DNS-provider integration.

Observability

Previously, 3.3 added persistent statistics and 3.4 introduced the OpenTelemetry add-on. Now, HAProxy 3.5 continues to make the world's fastest software load balancer more observable.

Named logger groups can send security events to a collector while other logs stay local. Master and worker IDs let you link a log line or metric to its source process. Embedded symbols retain HAProxy function names in backtraces from stripped builds. You can also log which hardening rule rejected a request. Use haload to generate a controlled load, then compare response times and memory use before and after a change.

Testing capacity with haload

HAProxy 3.5 includes haload, a load generator built on HAProxy's network stack. It replaces h1load, adding HTTP/2 and HTTP/3 testing alongside HTTP/1. You can set a request rate and report latency percentiles to compare configurations or measure an application's capacity.

Build a cleartext test client with:

make -j2 TARGET=linux-glibc haload

In the following example, we use two threads and ten simulated users to send up to 200 request attempts per second for 30 seconds:

./haload -h1 -t 2 -u 10 -R 200 -d 30 -P -hs http://127.0.0.1:8080/

The -P option reports time-to-first-byte and time-to-last-byte percentiles; -hs includes the HTTP status-code distribution. TLS and HTTP/3 tests use builds with the corresponding TLS and QUIC support.

Loggers section

The new loggers section gives you a way to organize groups of servers that receive HAProxy logs. It's an alternative to defining log directives directly in global, defaults, frontend, and backend sections.

In this example, we declare a loggers group named my-syslog-servers and add a log server.

loggers my-syslog-servers
log 172.16.0.50:514 local0 info

We then refer to the group with a log to directive in a defaults section.

defaults mydefaults
log to my-syslog-servers

Other observability improvements

The master_id and worker_id fetches link logs and metrics to a process, including workers created during reloads. Embedded symbols keep HAProxy function names available in backtraces from supported stripped builds. Hardening fetches also report which conditions were detected and which rules acted on them.

The new +utf8 encoding flag keeps valid UTF-8 readable in encoded logs. The halog -hdr-match option selects entries by captured header values. Memory profiling produces diagnostic output faster and no longer counts certain allocations twice.

Management

HAProxy 3.5 extends 3.3's idle-connection cleanup and 3.4's dynamic backends with simpler batch maintenance for servers and backends. Removal runs in the background, without scripts polling the CLI for completion. CLI wait and show events now work in non-interactive scripts.

A global setting controls frontend HTTP/2 across listeners. You can also rename a server or reset its counters independently, keeping the remaining pool's statistics available for comparison.

Runtime backend lifecycle

HAProxy 3.4 introduced runtime backend creation. Version 3.5 adds background server and backend removal through the HAProxy Runtime API. The purge commands schedule cleanup so scripts can batch additions and removals without monitoring each removal's completion through the CLI. Use wait when a later step depends on cleanup finishing, such as reusing a backend name.

The add backend command, introduced in 3.4, is no longer experimental in 3.5.

In the following example, traffic has already moved away from the dynamically created backend old_pool. We unpublish it, request removal of its servers and the backend, then wait for its name to disappear:

printf '%s\n' \
'unpublish backend old_pool' \
'purge all servers old_pool' \
'purge backend old_pool' \
'wait -u 30s be-unknown old_pool' \
| socat -t35 - UNIX-CONNECT:/run/haproxy/admin.sock

The wait -u command continues when the pipeline closes its input. Here, it waits up to 30 seconds for backend removal. For one server, use purge server followed by the srv-unknown wait condition.

Other management improvements

The global tune.h2.fe.enabled setting controls HTTP/2 across frontends. Rules can use h2_enabled to adapt headers or redirects to that setting.

You can prepare a backend with be-unpublished before making it visible to routing rules, rename servers, or reset one server's counters. Other settings control retained defaults and show which thread group owns a connection. MySQL checks gain a post-80-sha2 mode for caching_sha2_password, while statistics-page actions respect the configured scope.

New converters

Converters transform values returned by sample fetches. HAProxy 3.5 adds the following converters:

Converter

Description

be_sort(<elem_size>)

Sorts big-endian integers in a binary sample into ascending order.

curve2name(<format>)

Converts a TLS curve name or group ID to ANSI, IANA, or NIST naming.

has_ctl([<mask>])

Detects control characters in a sample, with an optional mask selecting which characters to match.

hdng_rej_name

Returns the name of the HTTP hardening rule that rejected a message.

jwt_verify_secret(<alg>,<secret>)

Verifies an HMAC-signed JWT using a shared secret.

ocsp_check_err_str

Converts an OCSP check's numeric error code into readable text.

tr([-<flags>,]<set1>[,<set2>])

Translates or deletes characters in strings and binary samples.

New fetches

Sample fetches retrieve values for access rules, logging, and other configuration expressions. The following fetches extend that information in HAProxy 3.5:

Fetch

Description

be_max_retries

Returns the configured connection-retry limit for the current backend.

bs.hdng.fixed

Returns a bitmask of HTTP hardening rules enforced on traffic received from the server.

bs.hdng.found

Returns a bitmask of hardening conditions detected in server traffic, including disabled checks.

cur_max_retries

Returns the stream's current connection-retry limit, including changes made by set-retries.

fs.hdng.fixed

Returns a bitmask of HTTP hardening rules enforced on traffic received from the client.

fs.hdng.found

Returns a bitmask of hardening conditions detected in client traffic, including disabled checks.

h2_enabled

Reports whether HTTP/2 was compiled in and is enabled for frontends.

master_id

Returns the master's unique ID, which remains unchanged across worker reloads.

ssl_c_policies([<oid>])

Lists client-certificate policy OIDs or checks for a specified policy OID.

worker_id

Returns the worker's unique ID, renewed when the worker is replaced on reload.

Some additions, including has_ctl and h2_enabled, are also available in maintained 3.4 builds.

Deprecations and breaking changes

HAProxy 3.5 has the following deprecations and breaking changes.

  • HAProxy's OpenTracing add-on was removed in this version, but you can use the new OpenTelemetry add-on instead. Sometimes, technology shifts quickly. In this case, HAProxy's support for OpenTracing had come at just the moment when the CNCF announced that the nascent standard was to be deprecated, with the goal of merging it into the more expansive OpenTelemetry framework. Check out the guide for using OpenTelemetry with HAProxy, which became available in HAProxy 3.4.

  • The global directive master-worker, which became deprecated in version 3.3, is now removed. This directive had enabled HAProxy's modern process management mode, but you can use the -W or -Ws startup arguments instead. Use the -Ws form for running in master-worker mode with systemd. In master-worker mode, HAProxy starts a primary "master" process that oversees multiple worker processes. To get an understanding of the evolution of how HAProxy runs, from daemon mode to now, watch William Lallemand's HAProxyConf 2019 talk, HAProxy Process Management.

  • The backend directives dispatch and option transparent, which were deprecated in version 3.3, are now removed. It has long been the recommendation to use a server directive instead of the dispatch directive, since server supports many more options including TLS. You can also replace option transparent with a server directive that has 0.0.0.0 as its address. See the tutorial, Enable transparent proxying.

  • Global directives related to tuning how HAProxy handles the QUIC protocol that were deprecated in version 3.3 are removed in this version: all directives that begin with tune.quic.frontend, and the directives tune.quic.cc.cubic.min-losses, tune.quic.cc-hystart, tune.quic.disable-tx-pacing, tune.quic.disable-udp-gso, tune.quic.max-frame-loss, tune.quic.reorder-ratio, and tune.quic.socket-owner. New directives replace each of these and are scoped to either frontend or backend connections.

  • This version sets the oldest supported version of OpenSSL to 1.1.1. If you'd like to skip compiling HAProxy yourself, you can install it using one of our performance packages on Linux. We call them that because they're built with the AWS-LC library instead of OpenSSL. Read why we chose AWS-LC for our packages in the blog post The State of SSL Stacks.

  • You can no longer declare the http-request cache-use and http-response cache-store directives in a defaults section. Putting them in a defaults sections never truly worked, since they implicitly rely on there being a filter, which you can't have in a defaults section.

  • Version 3.5 removes the tune.takeover-other-tg-connections global directive that was deprecated in version 3.4. Replace it with tune.idle-pool.shared.

  • HAProxy now places its process into a chroot jail by default, whereas this had been an opt-in behavior enabled with the global chroot directive. You can disable this by setting an explicit chroot /, which sets the chrooted directory to the root of the filesystem.

  • The jwt_verify converter has been split into jwt_verify_secret and jwt_verify_cert converters to protect against a security risk caused by the original converter interpreting the meaning of its second argument differently depending on the algorithm specified in its first argument. If the configuration doesn't include a line that checks the verification algorithm, an attacker could try to trick the load balancer into treating a certificate path like an HMAC symmetric secret. They could send file path values as the secret until one matches. Separating the verification of secrets from the verification of certificates avoids this ambiguity.

  • When you connect HAProxy to your backend servers over HTTPS, and you verify the servers' TLS certificate by adding a verify required argument to the server directives, and that certificate contains a Subject Alternative Name (SAN) value, then HAProxy will no longer fall back to verifying against the certificate's Common Name (CN) if the SAN doesn't match. This adheres to RFC 6125, which forbids falling back to the Common Name when the certificate has a Subject Alternative Name.

  • HAProxy's internal HTTP client, which it uses to make requests to ACME and OCSP servers, and which you can use in Lua scripts via the HTTPClient class, now applies the ssl-default-server-* settings that you define in your configuration, whereas before it used its own built-in defaults. Be sure to verify that your scripts, OCSP stapling, and ACME certificates work as expected.

  • The list of HTTP protocol violations that will cause HAProxy to reject a request or response grew to include invalid HTTP version strings, non-three-digit status codes, TRACE requests with bodies, HTTP/1.0 informational responses, malformed chunk extensions, and a malformed authority. You can allow any of them individually with the new acceptable-http-request-violations and acceptable-http-response-violations global directives.

  • At startup, HAProxy now prints a notification if it detects that one of your http-request rules could be bypassed by a client sending the same request, but with a different form. For example, instead of requesting the path /admin, which you're expecting, they request /Admin, /admin/, or possibly //admin. Consult the documentation topic Secure filtering of HTTP requests to learn how you can write your rules so that they aren't bypassed (for instance, deny all access and then permit access to specific matching URLs instead of denying access to specific URLs). 

  • The experimental ktls on directive introduced in version 3.3, which offloads a part of TLS processing to the Linux kernel, is now automatically switched off if HAProxy detects that it's running with a version of OpenSSL affected by a bug that corrupts streams. You can force HAProxy to use kTLS anyway by setting tune.ssl.ktls-unsafe, but it's better to update OpenSSL. The bug has been fixed in OpenSSL versions 3.4.6 and 3.5.7.

  • The HAProxy Statistics dashboard now adheres to the stats scope setting when applying administrative actions. That means that if a dashboard has been scoped to show only some proxies, the administrative actions can be applied only to those proxies, which wasn't enforced before.

  • When you define an access log format that stores messages as JSON, non-printable ASCII characters, for examples tabs, are now escaped as a hash symbol (#) followed by two hexadecimal digits, #HH. This prevents those characters from making invalid JSON. Use the +json and +utf8 flags together to preserve special characters as UTF-8 sequences.

  • If you set a server directive in a backend to have a DNS hostname instead of an IP address, that hostname must be 63 characters or less, or else HAProxy emits a fatal error. This is a limitation of the DNS protocol. You can, however, set the global directive unresolvable-server-fqdn to warn to get a warning instead of a fatal error. HAProxy will put the server into maintenance mode.

  • Because the ALPN value hq-interop is meant for QUIC interoperability testing, not for production use, HAProxy 3.5 allows you to use it only after you've set the expose-experimental-directives and tune.quic.interop global directives. 

  • The default value for tune.runqueue-depth is now 280 instead of a dynamic value determined by the number of threads.

  • Server-sent events, which allow a server to push messages to a web page at any time and are indicated by Content-Type: text/event-stream, now automatically switch to low-latency mode (option http-no-delay).

  • If you use caching and compression in the same proxy, their order matters. In previous versions, you'd get an error if you didn't explicitly declare the filter directives in the order you wanted. In this version, they're sorted automatically if you don't explicitly declare the filters, but use the http-response cache-store and compression directives, in which case the order becomes decompression, caching, then compression. You can still set the order explicitly by either declaring the filter directives or by using the filter-sequence directive with the new filter-config and filter-enable directives.

Upgrade to HAProxy 3.5

You can install HAProxy 3.5 using one of these methods:

Before upgrading, validate the configuration and test real client traffic in staging. Some settings are removed, while changed defaults can affect authentication and access to local resources.

Conclusion

HAProxy 3.5 combines stricter HTTP checks for untrusted connections with filesystem isolation that limits a proxy process's access to files. Native decompression helps reduce bandwidth use between cloud sites, while reusable server profiles and runtime commands support automated backend provisioning and retirement. The new haload tool lets you measure capacity, and an experimental mode reduces contention on servers with many CPU cores. Process identifiers and improved backtraces help you trace production failures to a specific worker or function.

HAProxy 3.5 builds on 3.3's multicore scaling and 3.4's dynamic backends, bringing HTTP hardening and background cleanup to the world's fastest software load balancer.

Did you know?

For enterprise security and centralized management, request a demo of HAProxy One, the world's fastest application delivery and security platform.

Thank you to the HAProxy community for the code, testing, and feedback behind this release.

Try HAProxy 3.5 with a representative application, and use haload to compare latency and throughput against your current setup.

Subscribe to our blog. Get the latest release updates, tutorials, and deep-dives from HAProxy experts.