]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
5 hours agoCI: github: skip a ssl library version when latest is already in the list master
William Lallemand [Mon, 7 Jul 2025 17:38:18 +0000 (19:38 +0200)] 
CI: github: skip a ssl library version when latest is already in the list

Skip the job for "latest" libssl version, when this version is the same
as a one already in the list.

This avoid having 2 jobs for OpenSSL 3.5.1 since no new dev version are
available for now and 3.5.1 is already in the list.

10 hours agoMINOR: server: support QUIC for dynamic servers quic-interop
Amaury Denoyelle [Mon, 7 Jul 2025 09:42:25 +0000 (11:42 +0200)] 
MINOR: server: support QUIC for dynamic servers

To properly support QUIC for dynamic servers, it is required to extend
add server CLI handler :
* ensure conformity between server address and proto
* automatically set proto to QUIC if not specified
* prepare_srv callback must be called to initialize required SSL context

Prior to this patch, crashes may occur when trying to use QUIC with
dynamic servers.

Also, destroy_srv callback must be called when a dynamic server is
deallocated. This ensures that there is no memory leak due to SSL
context.

No need to backport.

10 hours agoMINOR: cfgparse: enforce QUIC MUX compat on server line
Amaury Denoyelle [Mon, 7 Jul 2025 09:20:28 +0000 (11:20 +0200)] 
MINOR: cfgparse: enforce QUIC MUX compat on server line

Add postparsing checks to control server line conformity regarding QUIC
both on the server address and the MUX protocol. An error is reported in
the following case :
* proto quic is explicitely specified but server address does not
  specify quic4/quic6 prefix
* another proto is explicitely specified but server address uses
  quic4/quic6 prefix

11 hours agoMINOR: quic-be: TLS version restriction to 1.3
Frederic Lecaille [Fri, 4 Jul 2025 14:38:06 +0000 (16:38 +0200)] 
MINOR: quic-be: TLS version restriction to 1.3

This patch skips the TLS version settings. They have as a side effect to add
all the TLS version extensions to the ClientHello message (TLS 1.0 to TLS 1.3).
QUIC supports only TLS 1.3.

11 hours agoMINOR: quic-be: Set the backend alpn if not set by conf
Frederic Lecaille [Thu, 3 Jul 2025 18:53:00 +0000 (20:53 +0200)] 
MINOR: quic-be: Set the backend alpn if not set by conf

Simply set the alpn string to "h3,hq_interop" if there is no "alpn" setting for
QUIC backends.

11 hours agoMINOR: reg-tests: first QUIC+H3 reg tests (QUIC address validation)
Frederic Lecaille [Wed, 2 Jul 2025 16:10:19 +0000 (18:10 +0200)] 
MINOR: reg-tests: first QUIC+H3 reg tests (QUIC address validation)

First simple VTC file for QUIC reg tests. Two listeners are configured, one without
Retry enabled and the other without. Two clients simply tries to connect to these
listeners to make an basic H3 request.

11 hours agoMINOR: quic: Prevent QUIC backend use with the OpenSSL QUIC compatibility module...
Frederic Lecaille [Wed, 2 Jul 2025 15:56:03 +0000 (17:56 +0200)] 
MINOR: quic: Prevent QUIC backend use with the OpenSSL QUIC compatibility module (USE_OPENSS_COMPAT)

Make the server line parsing fail when a QUIC backend is configured  if haproxy
is built to use the OpenSSL stack compatibility module. This latter does not
support the QUIC client part.

11 hours agoBUG/MINOR: quic-be: Malformed coalesced Initial packets
Frederic Lecaille [Wed, 2 Jul 2025 14:37:02 +0000 (16:37 +0200)] 
BUG/MINOR: quic-be: Malformed coalesced Initial packets

This bug fix completes this patch which was not sufficient:

   MINOR: quic-be: Allow sending 1200 bytes Initial datagrams

This patch could not allow the build of well formed Initial packets coalesced to
others (Handshake) packets. Indeed, the <padding> parameter passed to qc_build_pkt()
is deduced from a first value: <padding> value and must be set to 1 for
the last encryption level. As a client, the last encryption level is always
the Handshake encryption level. But <padding> was always set to 1 for a QUIC
client, leading the first Initial packet to be malformed because considered
as the second one into the same datagram.

So, this patch sets <padding> value passed to qc_build_pkt() to 1 only when there
is no last encryption level at all, to allow the build of Initial only packets
(not coalesced) or when it frames to send (coalesced packets).

No need to backport.

11 hours agoBUG/MINOR: quic: Missing TLS 1.3 QUIC cipher suites and groups inits (OpenSSL 3.5...
Frederic Lecaille [Wed, 2 Jul 2025 12:54:41 +0000 (14:54 +0200)] 
BUG/MINOR: quic: Missing TLS 1.3 QUIC cipher suites and groups inits (OpenSSL 3.5 QUIC API)

This bug impacts both QUIC backends and frontends with OpenSSL 3.5 as QUIC API.

The connections to a haproxy QUIC listener from a haproxy QUIC backend could not
work at all without HelloRetryRequest TLS messages emitted by the backend
asking the QUIC client to restart the handshake followed by TLS alerts:

    conn. @(nil) OpenSSL error[0xa000098] read_state_machine: excessive message size

Furthermore, the Initial CRYPTO data sent by the client were big (about two 1252 bytes
packets) (ClientHello TLS message). After analyzing the packets a key_share extension
with <unknown> as value was long (more that 1Ko). This extension is in relation with
the groups but does not belong to the groups supported by QUIC.

That said such connections could work with ngtcp2 as backend built against the same
OSSL TLS stack API but with a HelloRetryRequest.

ngtcp2 always set the QUIC default cipher suites and group, for all the stacks it
supports as implemented by this patch.

So this patch configures both QUIC backend and frontend cipher suites and groups
calling SSL_CTX_set_ciphersuites() and SSL_CTX_set1_groups_list() with the correct
argument, except for SSL_CTX_set1_groups_list() which fails with QUIC TLS for
a unknown reason at this time.

The call to SSL_CTX_set_options() is useless from ssl_quic_initial_ctx() for the QUIC
clients. One relies on ssl_sock_prepare_srv_ssl_ctx() to set them for now on.

This patch is effective for all the supported stacks without impact for AWS-LC,
and QUIC TLS and fixes the connections for haproxy QUIC frontend and backends
when builts against OpenSSL 3.5 QUIC API).

A new define HAVE_OPENSSL_QUICTLS has been added to openssl-compat.h to distinguish
the QUIC TLS stack.

Must be backported to 3.2.

11 hours agoCI: github: update to OpenSSL 3.5.1
William Lallemand [Mon, 7 Jul 2025 11:58:38 +0000 (13:58 +0200)] 
CI: github: update to OpenSSL 3.5.1

Update the OpenSSL 3.5 job to 3.5.1.

This must be backported to 3.2.

13 hours agoBUG/MEDIUM: quic: SSL/TCP handshake failures with OpenSSL 3.5
Frederic Lecaille [Mon, 7 Jul 2025 10:01:22 +0000 (12:01 +0200)] 
BUG/MEDIUM: quic: SSL/TCP handshake failures with OpenSSL 3.5

This bug arrived with this commit:

    MINOR: quic: OpenSSL 3.5 internal QUIC custom extension for transport parameters reset

To make QUIC connection succeed with OpenSSL 3.5 API, a call to quic_ssl_set_tls_cbs()
was needed from several callback which call SSL_set_SSL_CTX(). This has as side effect
to set the QUIC callbacks used by the OpenSSL 3.5 API.

But quic_ssl_set_tls_cbs() was also called for TCP sessions leading the SSL stack
to run QUIC code, if the QUIC support is enabled.

To fix this, simply ignore the TCP connections inspecting the <ssl_qc_app_data_index>
index value which is NULL for such connections.

Must be backported to 3.2.

15 hours agoCI: github: update the stable CI to ubuntu-24.04
William Lallemand [Mon, 7 Jul 2025 07:29:33 +0000 (09:29 +0200)] 
CI: github: update the stable CI to ubuntu-24.04

Update the stable CI to ubuntu-24.04.

Must be backported to 3.2.

16 hours agoCI: github: add an OpenSSL 3.5.0 job
William Lallemand [Mon, 7 Jul 2025 07:27:17 +0000 (09:27 +0200)] 
CI: github: add an OpenSSL 3.5.0 job

Add an OpenSSL 3.5.0 job to test USE_QUIC.

This must be backported to 3.2.

16 hours agoCI: enable USE_QUIC=1 for OpenSSL versions >= 3.5.0
Ilia Shipitsin [Mon, 7 Jul 2025 06:53:21 +0000 (08:53 +0200)] 
CI: enable USE_QUIC=1 for OpenSSL versions >= 3.5.0

OpenSSL 3.5.0 introduced experimental support for QUIC. This change enables the use_quic option when a compatible version of OpenSSL is detected, allowing QUIC-based functionality to be leveraged where applicable. Feature remains disabled for earlier versions to ensure compatibility.

41 hours agoCI: set DEBUG_STRICT=2 for coverity scan
Ilia Shipitsin [Sat, 5 Jul 2025 15:18:42 +0000 (17:18 +0200)] 
CI: set DEBUG_STRICT=2 for coverity scan

enabling DEBUG_STRICT=2 will enable BUG_ON_HOT() and help coverity
in bug detection

for the reference: https://github.com/haproxy/haproxy/issues/3008

3 days agoMINOR: pattern: add a counter of added/freed patterns
Willy Tarreau [Fri, 4 Jul 2025 22:07:25 +0000 (00:07 +0200)] 
MINOR: pattern: add a counter of added/freed patterns

Patterns are allocated when loading maps/acls from a file or dynamically
via the CLI, and are released only from the CLI (e.g. "clear map xxx").
These ones do not use pools and are much harder to monitor, e.g. in case
a script adds many and forgets to clear them, etc.

Let's add a new pair of metrics "PatternsAdded" and "PatternsFreed" that
will report the number of added and freed patterns respectively. This
can allow to simply graph both. The difference between the two normally
represents the number of allocated patterns. If Added grows without
Freed following, it can indicate a faulty script that doesn't perform
the needed cleanup. The metrics are also made available to Prometheus
as patterns_added_total and patterns_freed_total respectively.

3 days agoCLEANUP: ssl: Rename ssl_trace-t.h to ssl_trace.h
Remi Tricot-Le Breton [Fri, 4 Jul 2025 13:17:59 +0000 (15:17 +0200)] 
CLEANUP: ssl: Rename ssl_trace-t.h to ssl_trace.h

This header does not actually contain any structures so it's best to
remove the '-t' from the name for better consistency.

3 days agoMEDIUM: httpclient: add a Content-Length when the payload is known
William Lallemand [Fri, 4 Jul 2025 07:05:21 +0000 (09:05 +0200)] 
MEDIUM: httpclient: add a Content-Length when the payload is known

This introduce a change of behavior in the httpclient API. When
generating a request with a payload buffer, the size of the buffer
payload is known and does not need to be streamed in chunks.

This patch force to sends payload buffer using a Content-Length header
in the request, however the behavior does not change if a callback is
still used instead of a buffer.

3 days agoBUG/MINOR: http-act: Fix parsing of the expression argument for pause action
Christopher Faulet [Fri, 4 Jul 2025 12:34:08 +0000 (14:34 +0200)] 
BUG/MINOR: http-act: Fix parsing of the expression argument for pause action

When the "pause" action is parsed, if an expression is used instead of a
static value, the position of the current argument after the expression
evaluation is incremented while it should not. The sample_parse_expr()
function already take care of it. However, it should still be incremented
when an time value was parsed.

This patch must be backported to 3.2.

3 days agoBUG/MINOR: proto-tcp: Take care to initialized tcp_md5sig structure
Christopher Faulet [Fri, 4 Jul 2025 06:32:05 +0000 (08:32 +0200)] 
BUG/MINOR: proto-tcp: Take care to initialized tcp_md5sig structure

When the TCP MD5 signature is enabled, on a listening socket or an outgoing
one, the tcp_md5sig structure must be initialized first.

It is a 3.3-specific issue. No backport needed.

4 days agoBUILD: cfgparse-tcp: Add _GNU_SOURCE for TCP_MD5SIG_MAXKEYLEN
Christopher Faulet [Thu, 3 Jul 2025 14:30:14 +0000 (16:30 +0200)] 
BUILD: cfgparse-tcp: Add _GNU_SOURCE for TCP_MD5SIG_MAXKEYLEN

It is required for the musl librairy to be sure TCP_MD5SIG_MAXKEYLEN is
defined and avoid build errors.

4 days agoMINOR: proto-tcp: Add support for TCP MD5 signature for listeners and servers
Christopher Faulet [Thu, 3 Jul 2025 13:16:47 +0000 (15:16 +0200)] 
MINOR: proto-tcp: Add support for TCP MD5 signature for listeners and servers

This patch adds the support for the RFC2385 (Protection of BGP Sessions via
the + TCP MD5 Signature Option) for the listeners and the servers. The
feature is only available on Linux. Keywords are not exposed otherwise.

By setting "tcp-md5sig <password>" option on a bind line, TCP segments of
all connections instantiated from the listening socket will be signed with a
16-byte MD5 digest. The same option can be set on a server line to protect
outgoing connections to the corresponding server.

The primary use case for this option is to allow BGP to protect itself
against the introduction of spoofed TCP segments into the connection
stream. But it can be useful for any very long-lived TCP connections.

A reg-test was added and it will be executed only on linux. All other
targets are excluded.

4 days agoBUG/MINOR: ssl/ocsp: fix definition discrepancies with ocsp_update_init()
William Lallemand [Thu, 3 Jul 2025 13:08:37 +0000 (15:08 +0200)] 
BUG/MINOR: ssl/ocsp: fix definition discrepancies with ocsp_update_init()

Since patch 20718f40b6 ("MEDIUM: ssl/ckch: add filename and linenum
argument to crt-store parsing"), the definition of ocsp_update_init()
and its declaration does not share the same arguments.

Must be backported to 3.2.

4 days agoDOC: deviceatlas build clarifications
David Carlier [Wed, 2 Jul 2025 13:11:30 +0000 (14:11 +0100)] 
DOC: deviceatlas build clarifications

Update accordingly the related documentation, removing/clarifying confusing
parts as it was more complicated than it needed to be.

4 days agoBUILD/MEDIUM: deviceatlas: fix when installed in custom locations.
David Carlier [Wed, 2 Jul 2025 13:00:07 +0000 (14:00 +0100)] 
BUILD/MEDIUM: deviceatlas: fix when installed in custom locations.

We are reusing DEVICEATLAS_INC/DEVICEATLAS_LIB when the DeviceAtlas
library had been compiled and installed with cmake and make install targets.
Works fine except when ldconfig is unaware of the path, thus adding
cflags/ldflags into the mix.

Ideally, to be backported down to the lowest stable branch.

5 days agoBUG/MINOR: ssl: crash in ssl_sock_io_cb() with SSL traces and idle connections
William Lallemand [Wed, 2 Jul 2025 14:05:20 +0000 (16:05 +0200)] 
BUG/MINOR: ssl: crash in ssl_sock_io_cb() with SSL traces and idle connections

TRACE_ENTER is crashing in ssl_sock_io_cb() in case a connection idle is
being stolen. Indeed the function could be called with a NULL context
and dereferencing it will crash.

This patch fixes the issue by initializing ctx only once it is usable,
and moving TRACE_ENTER after the initialization.

This must be backported to 3.2.

5 days agoBUILD: dev/phash: remove the accidentally committed a.out file
Willy Tarreau [Wed, 2 Jul 2025 08:54:03 +0000 (10:54 +0200)] 
BUILD: dev/phash: remove the accidentally committed a.out file

Commit 41f28b3c53 ("DEV: phash: Update 414 and 431 status codes to phash")
accidentally committed a.out, resulting in build/checkout issues when
locally rebuilt. Let's drop it.

This should be backported to 3.1.

6 days agoMINOR: httpclient/cli: add --htx option
William Lallemand [Thu, 30 Jan 2025 16:15:36 +0000 (17:15 +0100)] 
MINOR: httpclient/cli: add --htx option

Use the new HTTPCLIENT_O_RES_HTX flag when using the CLI httpclient with
--htx.

It allows to process directly the response in HTX, then the htx_dump()
function is used to display a debug output.

Example:

echo "httpclient --htx GET https://haproxy.org" | socat /tmp/haproxy.sock
 htx=0x79fd72a2e200(size=16336,data=139,used=6,wrap=NO,flags=0x00000010,extra=0,first=0,head=0,tail=5,tail_addr=139,head_addr=0,end_addr=0)
[0] type=HTX_BLK_RES_SL    - size=31     - addr=0      HTTP/2.0 301
[1] type=HTX_BLK_HDR       - size=15     - addr=31     content-length: 0
[2] type=HTX_BLK_HDR       - size=32     - addr=46     location: https://www.haproxy.org/
[3] type=HTX_BLK_HDR       - size=25     - addr=78     alt-svc: h3=":443"; ma=3600
[4] type=HTX_BLK_HDR       - size=35     - addr=103    set-cookie: served=2:TLSv1.3+TCP:IPv4
[5] type=HTX_BLK_EOH       - size=1      - addr=138    <empty>

6 days agoMEDIUM: httpclient: implement a way to use directly htx data
William Lallemand [Wed, 5 Feb 2025 21:28:09 +0000 (22:28 +0100)] 
MEDIUM: httpclient: implement a way to use directly htx data

Add a HTTPCLIENT_O_RES_HTX flag which allow to store directly the HTX
data in the response buffer instead of extracting the data in raw
format.

This is useful when the data need to be reused in another request.

6 days agoMEDIUM: httpclient: split the CLI from the actual httpclient API
William Lallemand [Tue, 1 Jul 2025 13:03:46 +0000 (15:03 +0200)] 
MEDIUM: httpclient: split the CLI from the actual httpclient API

This patch split the httpclient code to prevent confusion between the
httpclient CLI command and the actual httpclient API.

Indeed there was a confusion between the flag used internally by the
CLI command, and the actual httpclient API.

hc_cli_* functions as well as HC_C_F_* defines were moved to
httpclient_cli.c.

6 days agoMINOR: ssl/ocsp: stop using the flags from the httpclient CLI
William Lallemand [Tue, 1 Jul 2025 13:43:45 +0000 (15:43 +0200)] 
MINOR: ssl/ocsp: stop using the flags from the httpclient CLI

The ocsp-update uses the flags from the httpclient CLI, which are not
supposed to be used elsewhere since this is a state for the CLI.

This patch implements HC_OCSP flags for the ocsp-update.

6 days agoBUG/MINOR: httpclient: wrongly named httpproxy flag
William Lallemand [Fri, 24 Jan 2025 16:53:04 +0000 (17:53 +0100)] 
BUG/MINOR: httpclient: wrongly named httpproxy flag

The HC_F_HTTPPROXY flag was wrongly named and does not use the correct
value, indeed this flag was meant to be used for the httpclient API, not
the httpclient CLI.

This patch fixes the problem by introducing HTTPCLIENT_FO_HTTPPROXY
which has must be set in hc->flags.

Also add a member 'options' in the httpclient structure, because the
member flags is reinitialized when starting.

Must be backported as far as 3.0.

6 days agoMEDIUM: stats: add persistent state to typed output format
Aurelien DARRAGON [Tue, 15 Apr 2025 09:49:42 +0000 (11:49 +0200)] 
MEDIUM: stats: add persistent state to typed output format

Add a fourth character to the second column of the "typed output format"
to indicate whether the value results from a volatile or persistent metric
('V' or 'P' characters respectively). A persistent metric means the value
could possibily be preserved across reloads by leveraging a shared memory
between multiple co-processes. Such metrics are identified as "shared" in
the code (since they are possibly shared between multiple co-processes)

Some reg-tests were updated to take that change into account, also, some
outputs in the configuration manual were updated to reflect current
behavior.

6 days agoMINOR: ssl: Introduce new smp_client_hello_parse() function
Mariam John [Wed, 30 Apr 2025 17:11:14 +0000 (12:11 -0500)] 
MINOR: ssl: Introduce new smp_client_hello_parse() function

In this patch we introduce a new helped function called `smp_client_hello_parse()` to extract
information presented in a TLS client hello handshake message. 7 sample fetches have also been
modified to use this helped function to do the common client hello parsing and use the result
to do further processing of extensions/cipher.

Fixes: #2532
7 days agoREGTESTS: restrict execution to a single thread group
Willy Tarreau [Mon, 30 Jun 2025 16:44:07 +0000 (18:44 +0200)] 
REGTESTS: restrict execution to a single thread group

When threads are enabled and running on a machine with multiple CCX
or multiple nodes, thread groups are now enabled since 3.3-dev2, causing
load-balancing algorithms to randomly fail due to incoming connections
spreading over multiple groups and using different load balancing indexes.

Let's just force "thread-groups 1" into all configs when threads are
enabled to avoid this.

7 days agoDOC: 'jwt_verify' converter now supports certificates
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:31 +0000 (16:56 +0200)] 
DOC: 'jwt_verify' converter now supports certificates

The 'jwt_verify' converter can now accept certificates as a second
parameter, which can be updated via the CLI.

7 days agoREGTESTS: jwt: Test update of certificate used in jwt_verify
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:30 +0000 (16:56 +0200)] 
REGTESTS: jwt: Test update of certificate used in jwt_verify

Using certificates in the jwt_verify converter allows to make use of the
CLI certificate updates, which is still impossible with public keys (the
legacy behavior).

7 days agoREGTESTS: jwt: Add test with actual certificate passed to jwt_verify
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:29 +0000 (16:56 +0200)] 
REGTESTS: jwt: Add test with actual certificate passed to jwt_verify

The jwt_verify can now take public certificates as second parameter,
either with actual certificate path (no previously mentioned) or from a
predefined crt-store or from a variable.

7 days agoMINOR: ssl: Prevent delete on certificate used by jwt_verify
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:28 +0000 (16:56 +0200)] 
MINOR: ssl: Prevent delete on certificate used by jwt_verify

A ckch_store used in JWT verification might not have any ckch instances
or crt-list entries linked but we don't want to be able to remove it via
the CLI anyway since it would make all future jwt_verify calls using
this certificate fail.

7 days agoMINOR: ssl: Allow 'commit ssl cert' with no privkey
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:27 +0000 (16:56 +0200)] 
MINOR: ssl: Allow 'commit ssl cert' with no privkey

The ckch_stores might be used to store public certificates only so in
this case we won't provide private keys when updating the certificate
via the CLI.
If the ckch_store is actually used in a bind or server line an error
will still be raised if the private key is missing.

7 days agoMAJOR: jwt: Allow certificate instead of public key in jwt_verify converter
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:26 +0000 (16:56 +0200)] 
MAJOR: jwt: Allow certificate instead of public key in jwt_verify converter

The 'jwt_verify' converter could only be passed public keys as second
parameter instead of full-on public certificates. This patch allows
proper certificates to be used.
Those certificates can be loaded in ckch_stores like any other
certificate which means that all the certificate-related operations that
can be made via the CLI can now benefit JWT validation as well.

We now have two ways JWT validation can work, the legacy one which only
relies on public keys which could not be stored in ckch_stores without
some in depth changes in the way the ckch_stores are built. In this
legacy way, the public keys are fully stored in a cache dedicated to JWT
only which does not have any CLI commands and any way to update them
during runtime. It also requires that all the public keys used are
passed at least once explicitely to the 'jwt_verify' converter so that
they can be loaded during init.
The new way uses actual certificates, either already stored in the
ckch_store tree (if predefined in a crt-store or already used previously
in the configuration) or loaded in the ckch_store tree during init if
they are explicitely used in the configuration like so:
    var(txn.bearer),jwt_verify(txn.jwt_alg,"cert.pem")

When using a variable (or any other way that can only be resolved during
runtime) in place of the converter's <key> parameter, the first time we
encounter a new value (for which we don't have any entry in the jwt
tree) we will lock the ckch_store tree and try to perform a lookup in
it. If the lookup fails, an entry will still be inserted into the jwt
tree so that any following call with this value avoids performing the
ckch_store tree lookup.

7 days agoMINOR: jwt: Remove unused parameter in convert_ecdsa_sig
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:25 +0000 (16:56 +0200)] 
MINOR: jwt: Remove unused parameter in convert_ecdsa_sig

The pubkey parameter in convert_ecdsa_sig was not actually used.

7 days agoMINOR: jwt: Rename pkey to pubkey in jwt_cert_tree_entry struct
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:24 +0000 (16:56 +0200)] 
MINOR: jwt: Rename pkey to pubkey in jwt_cert_tree_entry struct

Rename the jwt_cert_tree_entry member pkey to pubkey to avoid any
confusion between private and public key.

7 days agoDOC: Fix 'jwt_verify' converter doc
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:23 +0000 (16:56 +0200)] 
DOC: Fix 'jwt_verify' converter doc

Contrary to what the doc says, the jwt_verify converter only works with
a public key and not a full certificate for certificate based protocols
(everything but HMAC).

This patch should be backported up to 2.8.

7 days agoBUG/MINOR: jwt: Copy input and parameters in dedicated buffers in jwt_verify converter
Remi Tricot-Le Breton [Mon, 30 Jun 2025 14:56:22 +0000 (16:56 +0200)] 
BUG/MINOR: jwt: Copy input and parameters in dedicated buffers in jwt_verify converter

When resolving variable values the temporary trash chunks are used so
when calling the 'jwt_verify' converter with two variable parameters
like in the following line, the input would be overwritten by the value
of the second parameter :
    var(txn.bearer),jwt_verify(txn.jwt_alg,txn.cert)
Copying the values into dedicated alloc'ed buffers prevents any new call
to get_trash_chunk from erasing the data we need in the converter.

This patch can be backported up to 2.8.

7 days agoBUG/MEDIUM: mux-h2: Properly handle connection error during preface sending
Christopher Faulet [Mon, 30 Jun 2025 14:23:39 +0000 (16:23 +0200)] 
BUG/MEDIUM: mux-h2: Properly handle connection error during preface sending

On backend side, an error at connection level during the preface sending was
not properly handled and could lead to a spinning loop on process_stream()
when the h2 stream on client side was blocked, for instance because of h2
flow control.

It appeared that no transition was perfromed from the PREFACE state to an
ERROR state on the H2 connection when an error occurred on the underlying
connection. In that case, the H2 connection was woken up in loop to try to
receive data, waking up the upper stream at the same time.

To fix the issue, an H2C error must be reported. Most state transitions are
handled by the demux function. So it is the right place to do so. First, in
PREFACE state and on server side, if an error occurred on the TCP
connection, an error is now reported on the H2 connection. REFUSED_STREAM
error code is used in that case. In addition, in that case, we also take
care to properly handle the connection shutdown.

This patch should fix the issue #3020. It must be backported to all stable
versions.

7 days agoBUG/MEDIUM: hlua: Forbid any L6/L7 sample fetche functions from lua services
Christopher Faulet [Tue, 24 Jun 2025 06:26:14 +0000 (08:26 +0200)] 
BUG/MEDIUM: hlua: Forbid any L6/L7 sample fetche functions from lua services

It was already forbidden to use HTTP sample fetch functions from lua
services. An error is triggered if it happens. However, the error must be
extended to any L6/L7 sample fetch functions.

Indeed, a lua service is an applet. It totally unexepected for an applet to
access to input data in a channel's buffer. These data have not been
analyzed yet and are still subject to any change. An applet, lua or not,
must never access to "not forwarded" data. Only output data are
available. For now, if a lua applet relies on any L6/L7 sampel fetch
functions, the behavior is undefined and not consistent.

So to fix the issue, hlua flag HLUA_F_MAY_USE_HTTP is renamed to
HLUA_F_MAY_USE_CHANNELS_DATA. This flag is used to prevent any lua applet to
use L6/L7 sample fetch functions.

This patch could be backported to all stable versions.

7 days agoMINOR: ssl: check TLS1.3 ciphersuites again in clienthello with recent AWS-LC
William Lallemand [Mon, 30 Jun 2025 14:20:29 +0000 (16:20 +0200)] 
MINOR: ssl: check TLS1.3 ciphersuites again in clienthello with recent AWS-LC

Patch ed9b8fec49 ("BUG/MEDIUM: ssl: AWS-LC + TLSv1.3 won't do ECDSA in
RSA+ECDSA configuration") partly fixed a cipher selection problem with
AWS-LC. However this was not checking anymore if the ciphersuites was
available in haproxy which is still a problem.

The problem was fixed in AWS-LC 1.46.0 with this PR
https://github.com/aws/aws-lc/pull/2092.

This patch allows to filter again the TLS13 ciphersuites with recent
versions of AWS-LC. However, since there are no macros to check the
AWS-LC version, it is enabled at the next AWS-LC API version change
following the fix in AWS-LC v1.50.0.

This could be backported where ed9b8fec49 was backported.

7 days agoMINOR: counters: rename last_change counter to last_state_change
Aurelien DARRAGON [Mon, 30 Jun 2025 13:55:56 +0000 (15:55 +0200)] 
MINOR: counters: rename last_change counter to last_state_change

Since proxy and server struct already have an internal last_change
variable and we cannot merge it with the shared counter one, let's
rename the last_change counter to be more specific and prevent the
mixup between the two.

last_change counter is renamed to last_state_change, and unlike the
internal last_change, this one is a shared counter so it is expected
to be updated by other processes in our back.

However, when updating last_state_change counter, we use the value
of the server/proxy last_change as reference value.

7 days agoMEDIUM: proxy: add and use a separate last_change variable for internal use
Aurelien DARRAGON [Mon, 30 Jun 2025 13:45:44 +0000 (15:45 +0200)] 
MEDIUM: proxy: add and use a separate last_change variable for internal use

Same motivation as previous commit, proxy last_change is "abused" because
it is used for 2 different purposes, one for stats, and the other one
for process-local internal use.

Let's add a separate proxy-only last_change variable for internal use,
and leave the last_change shared (and thread-grouped) counter for
statistics.

7 days agoMEDIUM: server: add and use a separate last_change variable for internal use
Aurelien DARRAGON [Mon, 30 Jun 2025 08:57:29 +0000 (10:57 +0200)] 
MEDIUM: server: add and use a separate last_change variable for internal use

last_change server metric is used for 2 separate purposes. First it is
used to report last server state change date for stats and other related
metrics. But it is also used internally, including in sensitive paths,
such as lb related stuff to take decision or perform computations
(ie: in srv_dynamic_maxconn()).

Due to last_change counter now being split over thread groups since 16eb0fa
("MAJOR: counters: dispatch counters over thread groups"), reading the
aggregated value has a cost, and we cannot afford to consult last_change
value from srv_dynamic_maxconn() anymore. Moreover, since the value is
used to take decision for the current process we don't wan't the variable
to be updated by another process in our back.

To prevent performance regression and sharing issues, let's instead add a
separate srv->last_change value, which is not updated atomically (given how
rare the  updates are), and only serves for places where the use of the
aggregated last_change counter/stats (split over thread groups) is too
costly.

7 days agoBUG/MEDIUM: counters/server: fix server and proxy last_change mixup
Aurelien DARRAGON [Mon, 30 Jun 2025 09:20:13 +0000 (11:20 +0200)] 
BUG/MEDIUM: counters/server: fix server and proxy last_change mixup

16eb0fa ("MAJOR: counters: dispatch counters over thread groups")
introduced some bugs: as a result of improper copy paste during
COUNTERS_SHARED_LAST() macro introduction, some functions such as
srv_downtime() which used to make use of the server last_change variable
now use the proxy one, which doesn't make sense and will likely cause
unexpected logical errors/bugs.

Let's fix them all at once by properly pointing to the server last_change
variable when relevant.

No backport needed.

10 days agoMINOR: mailers: warn if mailers are configured but not actually used
Aurelien DARRAGON [Fri, 27 Jun 2025 14:28:48 +0000 (16:28 +0200)] 
MINOR: mailers: warn if mailers are configured but not actually used

Now that native mailers configuration is only usable with Lua mailers,
Willy noticed that we lack a way to warn the user if mailers were
previously configured on an older version but Lua mailers were not loaded,
which could trick the user into thinking mailers keep working when
transitionning to 3.2 while it is not.

In this patch we add the 'core.use_native_mailers_config()' Lua function
which should be called in Lua script body before making use of
'Proxy:get_mailers()' function to retrieve legacy mailers configuration
from haproxy main config. This way haproxy effectively knows that the
native mailers config is actually being used from Lua (which indicates
user correctly migrated from native mailers to Lua mailers), else if
mailers are configured but not used from Lua then haproxy warns the user
about the fact that they will be ignored unless they are used from Lua.
(e.g.: using the provided 'examples/lua/mailers.lua' to ease transition)

10 days agoMINOR: server: move send-proxy* incompatibility check in _srv_check_proxy_mode()
Aurelien DARRAGON [Fri, 27 Jun 2025 10:03:30 +0000 (12:03 +0200)] 
MINOR: server: move send-proxy* incompatibility check in _srv_check_proxy_mode()

This way the check is executed no matter the section where the server
is declared (ie: not only under the "ring" section)

10 days agoMEDIUM: server: move _srv_check_proxy_mode() checks from server init to finalize
Aurelien DARRAGON [Fri, 27 Jun 2025 10:15:24 +0000 (12:15 +0200)] 
MEDIUM: server: move _srv_check_proxy_mode() checks from server init to finalize

_srv_check_proxy_mode() is currently executed during server init (from
_srv_parse_init()), while it used to be fine for current checks, it
seems it occurs a bit too early to be usable for some checks that depend
on server keywords to be evaluated for instance.

As such, to make _srv_check_proxy_mode() more relevant and be extended
with additional checks in the future, let's call it later during server
finalization, once all server keywords were evaluated.

No change of behavior is expected

10 days agoMEDIUM: sink: change the sink mode type to PR_MODE_SYSLOG
Aurelien DARRAGON [Fri, 27 Jun 2025 10:05:16 +0000 (12:05 +0200)] 
MEDIUM: sink: change the sink mode type to PR_MODE_SYSLOG

No change of behavior expected, but some compat checks will now be aware
that the proxy type is not TCP but SYSLOG instead.

10 days agoBUG/MINOR: quic-be: Wrong retry_source_connection_id check
Frederic Lecaille [Fri, 27 Jun 2025 05:53:28 +0000 (07:53 +0200)] 
BUG/MINOR: quic-be: Wrong retry_source_connection_id check

This commit broke the QUIC backend connection to servers without address validation
or retry activated:

  MINOR: quic-be: address validation support implementation (RETRY)

Indeed the retry_source_connection_id transport parameter was already checked as
as if it was required, as if the peer (server) was always using the address validation.
Furthermore, relying on ->odcid.len to ensure a retry token was received is not
correct.

This patch ensures the retry_source_connection_id transport parameter is checked
only when a retry token was received (->retry_token != NULL). In this case
it also checks that this transport parameter is present when a retry token
has been received (tx_params->retry_source_connection_id.len != 0).

No need to backport.

11 days ago[RELEASE] Released version 3.3-dev2 v3.3-dev2
Willy Tarreau [Thu, 26 Jun 2025 16:26:45 +0000 (18:26 +0200)] 
[RELEASE] Released version 3.3-dev2

Released version 3.3-dev2 with the following main changes :
    - BUG/MINOR: config/server: reject QUIC addresses
    - MINOR: server: implement helper to identify QUIC servers
    - MINOR: server: mark QUIC support as experimental
    - MINOR: mux-quic-be: allow QUIC proto on backend side
    - MINOR: quic-be: Correct Version Information transp. param encoding
    - MINOR: quic-be: Version Information transport parameter check
    - MINOR: quic-be: Call ->prepare_srv() callback at parsing time
    - MINOR: quic-be: QUIC backend XPRT and transport parameters init during parsing
    - MINOR: quic-be: QUIC server xprt already set when preparing their CTXs
    - MINOR: quic-be: Add a function for the TLS context allocations
    - MINOR: quic-be: Correct the QUIC protocol lookup
    - MINOR: quic-be: ssl_sock contexts allocation and misc adaptations
    - MINOR: quic-be: SSL sessions initializations
    - MINOR: quic-be: Add a function to initialize the QUIC client transport parameters
    - MINOR: sock: Add protocol and socket types parameters to sock_create_server_socket()
    - MINOR: quic-be: ->connect() protocol callback adaptations
    - MINOR: quic-be: QUIC connection allocation adaptation (qc_new_conn())
    - MINOR: quic-be: xprt ->init() adapatations
    - MINOR: quic-be: add field for max_udp_payload_size into quic_conn
    - MINOR: quic-be: Do not redispatch the datagrams
    - MINOR: quic-be: Datagrams and packet parsing support
    - MINOR: quic-be: Handshake packet number space discarding
    - MINOR: h3-be: Correctly retrieve h3 counters
    - MINOR: quic-be: Store asap the DCID
    - MINOR: quic-be: Build post handshake frames
    - MINOR: quic-be: Add the conn object to the server SSL context
    - MINOR: quic-be: Initial packet number space discarding.
    - MINOR: quic-be: I/O handler switch adaptation
    - MINOR: quic-be: Store the remote transport parameters asap
    - MINOR: quic-be: Missing callbacks initializations (USE_QUIC_OPENSSL_COMPAT)
    - MINOR: quic-be: Make the secret derivation works for QUIC backends (USE_QUIC_OPENSSL_COMPAT)
    - MINOR: quic-be: SSL_get_peer_quic_transport_params() not defined by OpenSSL 3.5 QUIC API
    - MINOR: quic-be: get rid of ->li quic_conn member
    - MINOR: quic-be: Prevent the MUX to send/receive data
    - MINOR: quic: define proper proto on QUIC servers
    - MEDIUM: quic-be: initialize MUX on handshake completion
    - BUG/MINOR: hlua: Don't forget the return statement after a hlua_yieldk()
    - BUILD: hlua: Fix warnings about uninitialized variables
    - BUILD: listener: fix 'for' loop inline variable declaration
    - BUILD: hlua: Fix warnings about uninitialized variables (2)
    - BUG/MEDIUM: mux-quic: adjust wakeup behavior
    - MEDIUM: backend: delay MUX init with ALPN even if proto is forced
    - MINOR: quic: mark ctrl layer as ready on quic_connect_server()
    - MINOR: mux-quic: improve documentation for snd/rcv app-ops
    - MINOR: mux-quic: define flag for backend side
    - MINOR: mux-quic: set expect data only on frontend side
    - MINOR: mux-quic: instantiate first stream on backend side
    - MINOR: quic: wakeup backend MUX on handshake completed
    - MINOR: hq-interop: decode response into HTX for backend side support
    - MINOR: hq-interop: encode request from HTX for backend side support
    - CLEANUP: quic-be: Add comments about qc_new_conn() usage
    - BUG/MINOR: quic-be: CID double free upon qc_new_conn() failures
    - MINOR: quic-be: Avoid SSL context unreachable code without USE_QUIC_OPENSSL_COMPAT
    - BUG/MINOR: quic: prevent crash on startup with -dt
    - MINOR: server: reject QUIC servers without explicit SSL
    - BUG/MINOR: quic: work around NEW_TOKEN parsing error on backend side
    - BUG/MINOR: http-ana: Properly handle keep-query redirect option if no QS
    - BUG/MINOR: quic: don't restrict reception on backend privileged ports
    - MINOR: hq-interop: handle HTX response forward if not enough space
    - BUG/MINOR: quic: Fix OSSL_FUNC_SSL_QUIC_TLS_got_transport_params_fn callback (OpenSSL3.5)
    - BUG/MINOR: quic: fix ODCID initialization on frontend side
    - BUG/MEDIUM: cli: Don't consume data if outbuf is full or not available
    - MINOR: cli: handle EOS/ERROR first
    - BUG/MEDIUM: check: Set SOCKERR by default when a connection error is reported
    - BUG/MINOR: mux-quic: check sc_attach_mux return value
    - MINOR: h3: support basic HTX start-line conversion into HTTP/3 request
    - MINOR: h3: encode request headers
    - MINOR: h3: complete HTTP/3 request method encoding
    - MINOR: h3: complete HTTP/3 request scheme encoding
    - MINOR: h3: adjust path request encoding
    - MINOR: h3: adjust auth request encoding or fallback to host
    - MINOR: h3: prepare support for response parsing
    - MINOR: h3: convert HTTP/3 response into HTX for backend side support
    - MINOR: h3: complete response status transcoding
    - MINOR: h3: transcode H3 response headers into HTX blocks
    - MINOR: h3: use BUG_ON() on missing request start-line
    - MINOR: h3: reject invalid :status in response
    - DOC: config: prefer-last-server: add notes for non-deterministic algorithms
    - CLEANUP: connection: remove unused mux-ops dedicated to QUIC
    - BUG/MINOR: mux-quic/h3: properly handle too low peer fctl initial stream
    - MINOR: mux-quic: support max bidi streams value set by the peer
    - MINOR: mux-quic: abort conn if cannot create stream due to fctl
    - MEDIUM: mux-quic: implement attach for new streams on backend side
    - BUG/MAJOR: fwlc: Count an avoided server as unusable.
    - MINOR: fwlc: Factorize code.
    - BUG/MEDIUM: quic: do not release BE quic-conn prior to upper conn
    - MAJOR: cfgparse: turn the same proxy name warning to an error
    - MAJOR: cfgparse: make sure server names are unique within a backend
    - BUG/MINOR: tools: only reset argument start upon new argument
    - BUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself
    - BUG/MINOR: log: Be able to use %ID alias at anytime of the stream's evaluation
    - MINOR: hlua: emit a log instead of an alert for aborted actions due to unavailable yield
    - MAJOR: mailers: remove native mailers support
    - BUG/MEDIUM: ssl/clienthello: ECDSA with ssl-max-ver TLSv1.2 and no ECDSA ciphers
    - DOC: configuration: add details on prefer-client-ciphers
    - MINOR: ssl: Add "renegotiate" server option
    - DOC: remove the program section from the documentation
    - MAJOR: mworker: remove program section support
    - BUG/MINOR: quic: wrong QUIC_FT_CONNECTION_CLOSE(0x1c) frame encoding
    - MINOR: quic-be: add a "CC connection" backend TX buffer pool
    - MINOR: quic: Useless TX buffer size reduction in closing state
    - MINOR: quic-be: Allow sending 1200 bytes Initial datagrams
    - MINOR: quic-be: address validation support implementation (RETRY)
    - MEDIUM: proxy: deprecate the "transparent" and "option transparent" directives
    - REGTESTS: update http_reuse_be_transparent with "transparent" deprecated
    - REGTESTS: script: also add a line pointing to the log file
    - DOC: config: explain how to deal with "transparent" deprecation
    - MEDIUM: proxy: mark the "dispatch" directive as deprecated
    - DOC: config: crt-list clarify default cert + cert-bundle
    - MEDIUM: cpu-topo: switch to the "performance" cpu-policy by default
    - SCRIPTS: drop the HTML generation from announce-release
    - BUG/MINOR: tools: use my_unsetenv instead of unsetenv
    - CLEANUP: startup: move comment about nbthread where it's more appropriate
    - BUILD: qpack: fix a build issue on older compilers

11 days agoBUILD: qpack: fix a build issue on older compilers
Willy Tarreau [Thu, 26 Jun 2025 16:09:24 +0000 (18:09 +0200)] 
BUILD: qpack: fix a build issue on older compilers

Got this on gcc-4.8:

  src/qpack-enc.c: In function 'qpack_encode_method':
  src/qpack-enc.c:168:3: error: 'for' loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < istlen(other); ++i)
     ^

This came from commit a0912cf914 ("MINOR: h3: complete HTTP/3 request
method encoding"), no backport is needed.

11 days agoCLEANUP: startup: move comment about nbthread where it's more appropriate
Valentine Krasnobaeva [Thu, 26 Jun 2025 14:50:19 +0000 (16:50 +0200)] 
CLEANUP: startup: move comment about nbthread where it's more appropriate

Move the comment about non_global_section_parsed just above the line, where
we reset it.

11 days agoBUG/MINOR: tools: use my_unsetenv instead of unsetenv
Valentine Krasnobaeva [Thu, 26 Jun 2025 14:49:12 +0000 (16:49 +0200)] 
BUG/MINOR: tools: use my_unsetenv instead of unsetenv

Let's use our own implementation of unsetenv() instead of the one, which is
provided in libc. Implementation from libc may vary in dependency of UNIX
distro. Implemenation from libc.so.1 ported on Illumos (see the link below) has
caused an eternal loop in the clean_env(), where we invoke unsetenv().

(https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/port/gen/getenv.c#L411C1-L456C1)

This is reported at GitHUB #3018 and the reporter has proposed the patch, which
we really appreciate! But looking at his fix and to the implementations of
unsetenv() in FreeBSD libc and in Linux glibc 2.31, it seems, that the algorithm
of clean_env() will perform better with our my_unsetenv() implementation.

This should be backported in versions 3.1 and 3.2.

11 days agoSCRIPTS: drop the HTML generation from announce-release
Willy Tarreau [Thu, 26 Jun 2025 16:01:02 +0000 (18:01 +0200)] 
SCRIPTS: drop the HTML generation from announce-release

It has not been used over the last 5 years or so and systematically
requires manual removal. Let's just stop producing it. Also take
this opportunity to add the missing link to /discussions.

11 days agoMEDIUM: cpu-topo: switch to the "performance" cpu-policy by default
Willy Tarreau [Thu, 26 Jun 2025 14:01:55 +0000 (16:01 +0200)] 
MEDIUM: cpu-topo: switch to the "performance" cpu-policy by default

As mentioned during the NUMA series development, the goal is to use
all available cores in the most efficient way by default, which
normally corresponds to "cpu-policy performance". The previous default
choice of "cpu-policy first-usable-node" was only meant to stay 100%
identical to before cpu-policy.

So let's switch the default cpu-policy to "performance" right now.
The doc was updated to reflect this.

11 days agoDOC: config: crt-list clarify default cert + cert-bundle
Maximilian Moehl [Thu, 26 Jun 2025 14:08:03 +0000 (16:08 +0200)] 
DOC: config: crt-list clarify default cert + cert-bundle

Clarify that HAProxy duplicates crt-list entries for multi-cert bundles
which can create unexpected side-effects as only the very first
certificate after duplication is considered as default implicitly.

11 days agoMEDIUM: proxy: mark the "dispatch" directive as deprecated
Willy Tarreau [Thu, 26 Jun 2025 13:29:47 +0000 (15:29 +0200)] 
MEDIUM: proxy: mark the "dispatch" directive as deprecated

As mentioned in [1], the "dispatch" directive from haproxy 1.0 has long
outlived its original purpose and still suffers from a number of technical
limitations (no checks, no SSL, no idle connes etc) and still hinders some
internal evolutions. It's now time to mark it as deprecated, and to remove
it in 3.5 [2]. It was already recommended against in the documentation but
remained popular in raw TCP environments for being shorter to write.

The directive will now cause a warning to be emitted, suggesting an
alternate method involving "server". The warning can be shut using
"expose-deprecated-directives". The rare configs from 1.0 where
"dispatch" is combined with sticky servers using cookies will just
need to set these servers's weights to zero to prevent them from
being selected by the load balancing algorithm. All of this is
explained in the doc with examples.

Two reg tests were using this method, one purposely for this directive,
which now has expose-deprecated-directives, and another one to test the
behavior of idle connections, which was updated to use "server" and
extended to test both "http-reuse never" and "http-reuse always".

[1] https://github.com/orgs/haproxy/discussions/2921
[2] https://github.com/haproxy/wiki/wiki/Breaking-changes

11 days agoDOC: config: explain how to deal with "transparent" deprecation
Willy Tarreau [Thu, 26 Jun 2025 12:50:44 +0000 (14:50 +0200)] 
DOC: config: explain how to deal with "transparent" deprecation

The explanations for the "option transparent" keyword were a bit scarce
regarding deprecation, so let's explain how to replace it with a server
line that does the same.

11 days agoREGTESTS: script: also add a line pointing to the log file
Willy Tarreau [Thu, 26 Jun 2025 12:33:09 +0000 (14:33 +0200)] 
REGTESTS: script: also add a line pointing to the log file

I never counted the number of hours I've been spending selecting then
copy-pasting the directory output and manually appending "/LOG" to read
a log file but it amounts in tens to hundreds. Let's just add a direct
pointer to the log file at the end of the log for a failed run.

11 days agoREGTESTS: update http_reuse_be_transparent with "transparent" deprecated
Willy Tarreau [Thu, 26 Jun 2025 12:28:36 +0000 (14:28 +0200)] 
REGTESTS: update http_reuse_be_transparent with "transparent" deprecated

With commit e93f3ea3f8 ("MEDIUM: proxy: deprecate the "transparent" and
"option transparent" directives") this one no longer works as the config
either has to be adjusted to use server 0.0.0.0 or to enable the deprecated
feature. The test used to validate a technical limitation ("transparent"
not supporting shared connections), indicated as being comparable to
"http-reuse never". Let's now duplicate the test for "http-reuse never"
and "http-reuse always" and validate both behaviors.

Take this opportunity to fix a few problems in this config:
  - use "nbthread 1": depending on the thread where the connection
    arrives, the connection may or may not be reused
  - add explicit URLs to the clients so that they can be recognized
    in the logs
  - add comments to make it clearer what to expect for each test

11 days agoMEDIUM: proxy: deprecate the "transparent" and "option transparent" directives
Willy Tarreau [Thu, 26 Jun 2025 09:55:47 +0000 (11:55 +0200)] 
MEDIUM: proxy: deprecate the "transparent" and "option transparent" directives

As discussed here [1], "transparent" (already deprecated) and
"option transparent" are horrible hacks which should really disappear
in favor of "server xxx 0.0.0.0" which doesn't rely on hackish code
path. This old feature is now deprecated in 3.3 and will disappear in
3.5, as indicated here [2]. A warning is emitted when used, explaining
how to proceed, and how to silence the warning using the global
"expose-deprecated-directives" if needed. The doc was updated to
reflect this new state.

[1] https://github.com/orgs/haproxy/discussions/2921
[2] https://github.com/haproxy/wiki/wiki/Breaking-changes

11 days agoMINOR: quic-be: address validation support implementation (RETRY)
Frederic Lecaille [Wed, 25 Jun 2025 16:11:24 +0000 (18:11 +0200)] 
MINOR: quic-be: address validation support implementation (RETRY)

- Add ->retry_token and ->retry_token_len new quic_conn struct members to store
  the retry tokens. These objects are allocated by quic_rx_packet_parse() and
  released by quic_conn_release().
- Add <pool_head_quic_retry_token> new pool for these tokens.
- Implement quic_retry_packet_check() to check the integrity tag of these tokens
  upon RETRY packets receipt. quic_tls_generate_retry_integrity_tag() is called
  by this new function. It has been modified to pass the address where the tag
  must be generated
- Add <resend> new parameter to quic_pktns_discard(). This function is called
  to discard the packet number spaces where the already TX packets and frames are
  attached to. <resend> allows the caller to prevent this function to release
  the in flight TX packets/frames. The frames are requeued to be resent.
- Modify quic_rx_pkt_parse() to handle the RETRY packets. What must be done upon
  such packets receipt is:
  - store the retry token,
  - store the new peer SCID as the DCID of the connection. Note that the peer will
    modify again its SCID. This is why this SCID is also stored as the ODCID
    which must be matched with the peer retry_source_connection_id transport parameter,
  - discard the Initial packet number space without flagging it as discarded and
    prevent retransmissions calling qc_set_timer(),
  - modify the TLS cryptographic cipher contexts (RX/TX),
  - wakeup the I/O handler to send new Initial packets asap.
- Modify quic_transport_param_decode() to handle the retry_source_connection_id
  transport parameter as a QUIC client. Then its caller is modified to
  check this transport parameter matches with the SCID sent by the peer with
  the RETRY packet.

11 days agoMINOR: quic-be: Allow sending 1200 bytes Initial datagrams
Frederic Lecaille [Wed, 25 Jun 2025 14:04:28 +0000 (16:04 +0200)] 
MINOR: quic-be: Allow sending 1200 bytes Initial datagrams

This easy to understand patch is not intrusive at all and cannot break the QUIC
listeners.

The QUIC client MUST always pad its datagrams with Initial packets. A "!l" (not
a listener) test OR'ed with the existing ones is added to satisfy the condition
to allow the build of such datagrams.

11 days agoMINOR: quic: Useless TX buffer size reduction in closing state
Frederic Lecaille [Wed, 25 Jun 2025 08:15:50 +0000 (10:15 +0200)] 
MINOR: quic: Useless TX buffer size reduction in closing state

There is no need to limit the size of the TX buffer to QUIC_MIN_CC_PKTSIZE bytes
when the connection is in closing state. There is already a test which limits the
number of bytes to be used from this TX buffer after this useless test removed.
It limits this number of bytes to the size of the TX buffer itself:

    if (end > (unsigned char *)b_wrap(buf))
    end = (unsigned char *)b_wrap(buf);

This is exactly what is needed when the connection is in closing state. Indeed,
the size of the TX buffers are limited to reduce the memory usage. The connection
only needs to send short datagrams with at most 2 packets with a CONNECTION_CLOSE*
frames. They are built only one time and backed up into small TX buffer allocated
from a dedicated pool.
The size of this TX buffer is QUIC_MAX_CC_BUFSIZE which depends on QUIC_MIN_CC_PKTSIZE:

 #define QUIC_MIN_CC_PKTSIZE  128
 #define QUIC_MAX_CC_BUFSIZE (2 * (QUIC_MIN_CC_PKTSIZE + QUIC_DGRAM_HEADLEN))

This size is smaller than an MTU.

This patch should be backported as far as 2.9 to ease further backports to come.

11 days agoMINOR: quic-be: add a "CC connection" backend TX buffer pool
Frederic Lecaille [Tue, 24 Jun 2025 08:55:22 +0000 (10:55 +0200)] 
MINOR: quic-be: add a "CC connection" backend TX buffer pool

A QUIC client must be able to close a connection sending Initial packets. But
QUIC client Initial packets must always be at least 1200 bytes long. To reduce
the memory use of TX buffers of a connection when in "closing" state, a pool
was dedicated for this purpose but with a too much reduced TX buffer size
(QUIC_MAX_CC_BUFSIZE).

This patch adds a "closing state connection" TX buffer pool with the same role
for QUIC backends.

11 days agoBUG/MINOR: quic: wrong QUIC_FT_CONNECTION_CLOSE(0x1c) frame encoding
Frederic Lecaille [Mon, 23 Jun 2025 14:52:09 +0000 (16:52 +0200)] 
BUG/MINOR: quic: wrong QUIC_FT_CONNECTION_CLOSE(0x1c) frame encoding

This is an old bug which was there since this commit:

     MINOR: quic: Avoid zeroing frame structures

It seems QUIC_FT_CONNECTION_CLOSE was confused with QUIC_FT_CONNECTION_CLOSE_APP
which does not include a "frame type" field. This field was not initialized
(so with a random value) which prevent the packet to be built because the
packet builder supposes the packet with such frames are very short.

Must be backported as far as 2.6.

12 days agoMAJOR: mworker: remove program section support
William Lallemand [Wed, 25 Jun 2025 14:11:34 +0000 (16:11 +0200)] 
MAJOR: mworker: remove program section support

This patch removes completely the support for the program section, the
parsing of the section as well as the internals in the mworker does not
support it anymore.

The program section was considered dysfonctional and not fully
compatible with the "mworker V3" model. Users that want to run an
external program must use their init system.

The documentation is cleaned up in another patch.

12 days agoDOC: remove the program section from the documentation
William Lallemand [Wed, 25 Jun 2025 13:42:57 +0000 (15:42 +0200)] 
DOC: remove the program section from the documentation

The program section is obsolete and can be remove from the
documentation.

12 days agoMINOR: ssl: Add "renegotiate" server option
Remi Tricot-Le Breton [Thu, 12 Jun 2025 13:08:28 +0000 (15:08 +0200)] 
MINOR: ssl: Add "renegotiate" server option

This "renegotiate" option can be set on SSL backends to allow secure
renegotiation. It is mostly useful with SSL libraries that disable
secure regotiation by default (such as AWS-LC).
The "no-renegotiate" one can be used the other way around, to disable
secure renegotation that could be allowed by default.
Those two options can be set via "ssl-default-server-options" as well.

12 days agoDOC: configuration: add details on prefer-client-ciphers
William Lallemand [Wed, 25 Jun 2025 12:41:45 +0000 (14:41 +0200)] 
DOC: configuration: add details on prefer-client-ciphers

prefer-client-ciphers does not work exactly the same way when used with
a dual algorithm stack (ECDSA + RSA). This patch details its behavior.

This patch must be backported in every maintained version.

Problem was discovered in #2988.

12 days agoBUG/MEDIUM: ssl/clienthello: ECDSA with ssl-max-ver TLSv1.2 and no ECDSA ciphers
William Lallemand [Thu, 12 Jun 2025 14:50:08 +0000 (16:50 +0200)] 
BUG/MEDIUM: ssl/clienthello: ECDSA with ssl-max-ver TLSv1.2 and no ECDSA ciphers

Patch 23093c72 ("BUG/MINOR: ssl: suboptimal certificate selection with TLSv1.3
and dual ECDSA/RSA") introduced a problem when prioritizing the ECDSA
with TLSv1.3.

Indeed, when a client with TLSv1.3 capabilities announce a list of
ECDSA sigalgs, a list of TLSv1.3 ciphersuites compatible with ECDSA,
but only RSA ciphers for TLSv1.2, and haproxy is configured to a
ssl-max-ver TLSv1.2, then haproxy would use the ECDSA keypair, but the
client wouldn't be able to process it because TLSv1.2 was negociated.

HAProxy would be configured like that:

  ssl-default-bind-options ssl-max-ver TLSv1.2

And a client could be used this way:

  openssl s_client -connect localhost:8443 -cipher ECDHE-ECDSA-AES128-GCM-SHA256 \
          -ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256

This patch fixes the issue by checking if TLSv1.3 was configured before
allowing ECDSA is an TLSv1.3 ciphersuite is in the list.

This could be backported where 23093c72 ("BUG/MINOR: ssl: suboptimal
certificate selection with TLSv1.3 and dual ECDSA/RSA") was backported.
However this is quite sensible and we should wait a bit before the
backport.

This should fix issue #2988

13 days agoMAJOR: mailers: remove native mailers support
Aurelien DARRAGON [Mon, 23 Jun 2025 20:32:08 +0000 (22:32 +0200)] 
MAJOR: mailers: remove native mailers support

As mentioned in 2.8 announce on the mailing list [1] and on the wiki [2]
native mailers were deprecated and planned for removal in 3.3. Now is
the time to drop the legacy code for native mailers which is based on a
tcpcheck "hack" and cannot be maintained. Lua mailers should be used as
a drop in replacement. Indeed, "mailers" and associated config directives
are preserved because mailers config is exposed to Lua, which helps smoothing
the transition from native mailers to Lua based ones.

As a reminder, to keep mailers configuration working as before without
making changes to the config file, simply add the line below to the global
section:

       lua-load examples/lua/mailers.lua

mailers.lua script (provided in the git repository, adjust path as needed)
may be customized by users familiar with Lua, by default it emulates the
behavior of the native (now removed) mailers.

[1]: https://www.mail-archive.com/haproxy@formilux.org/msg43600.html
[2]: https://github.com/haproxy/wiki/wiki/Breaking-changes

13 days agoMINOR: hlua: emit a log instead of an alert for aborted actions due to unavailable...
Aurelien DARRAGON [Mon, 23 Jun 2025 14:23:33 +0000 (16:23 +0200)] 
MINOR: hlua: emit a log instead of an alert for aborted actions due to unavailable yield

As reported by Chris Staite in GH #3002, trying to yield from a Lua
action during a client disconnect causes the script to be interrupted
(which is expected) and an alert to be emitted with the error:
"Lua function '%s': yield not allowed".

While this error is well suited for cases where the yield is not expected
at all (ie: when context doesn't allow it) and results from a yield misuse
in the Lua script, it isn't the case when the yield is exceptionnally not
available due to an abort or error in the request/response processing.
Because of that we raise an alert but the user cannot do anything about it
(the script is correct), so it is confusing and polluting the logs.

In this patch we introduce the ACT_OPT_FINAL_EARLY flag which is a
complementary flag to ACT_OPT_FIRST. This flag is set when the
ACT_OPT_FIRST is set earlier than normal (due to error/abort).
hlua_action() then checks for this flag to decide whether an error (alert)
or a simple log message should be emitted when the yield is not available.

It should solve GH #3002. Thanks to Chris Staite (@chrisstaite-menlo) for
having reported the issue and suggested a solution.

13 days agoBUG/MINOR: log: Be able to use %ID alias at anytime of the stream's evaluation
Christopher Faulet [Mon, 23 Jun 2025 05:50:01 +0000 (07:50 +0200)] 
BUG/MINOR: log: Be able to use %ID alias at anytime of the stream's evaluation

In a log-format string, using "%[unique-id]" or "%ID" should be equivalent.
However, for the first one, the unique ID is generated when the sample fetch
function is called. For the alias, it is not true. It that case, the
stream's unique ID is generated when the log message is emitted. Otherwise,
by default, the unique id is automatically generated at the end of the HTTP
request analysis.

So, if the alias "%ID" is use in a log-format string anywhere before the end
of the request analysis, the evaluation failed and the ID is considered as
empty. It is not consistent and in contradiction with the "%ID"
documentation.

To fix the issue, instead of evaluating the unique ID when the log message
is emitted, it is now performed on demand when "%ID" format is evaluated.

This patch should fix the issue #3016. It should be backported to all stable
versions. It relies on the following commit:

  * BUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself

13 days agoBUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself
Christopher Faulet [Mon, 23 Jun 2025 05:33:06 +0000 (07:33 +0200)] 
BUG/MINOR: stream: Avoid recursive evaluation for unique-id based on itself

There is nothing that prevent a "unique-id-format" to reference itself,
using '%ID' or '%[unique-id]'. If the sample fetch function is used, it
leads to an infinite loop, calling recursively the function responsible to
generate the unique ID.

One solution is to detect it during the configuration parsing to trigger an
error. With this patch, we just inhibit recursive calls by considering the
unique-id as empty during its evaluation. So "id-%[unique-id]" lf string
will be evaluated as "id-".

This patch must be backported to all stable versions.

2 weeks agoBUG/MINOR: tools: only reset argument start upon new argument
Willy Tarreau [Mon, 23 Jun 2025 16:33:31 +0000 (18:33 +0200)] 
BUG/MINOR: tools: only reset argument start upon new argument

In issue #2995, Thomas Kjaer reported that empty argument position
reporting had been broken yet again. This time it was broken by this
latest fix: 2b60e54fb1 ("BUG/MINOR: tools: improve parse_line()'s
robustness against empty args"). It turns out that this fix is not
the culprit and it's in fact correct. The culprit was the original
commit of this series, 7e4a2f39ef ("BUG/MINOR: tools: do not create
an empty arg from trailing spaces"), which used to reset arg_start
to outpos for every new char in addition to doing it for every arg.
This resulted in the end of the line to be seen as always being in
error, thus reporting an incorrect position that the caller would
correct in a generic way designating the beginning of the line. It
didn't reveal prior to the upper fix above because the misassigned
value was almost not used by then.

Assigning the value before entering the loop fixes this problem and
doens't break the series of previous oss-fuzz reproducers. Hopefully
it's the last one again.

This must be backported to 3.2. Thanks to @tkjaer for reporting the
issue along with a reproducer.

2 weeks agoMAJOR: cfgparse: make sure server names are unique within a backend
Willy Tarreau [Mon, 23 Jun 2025 13:42:32 +0000 (15:42 +0200)] 
MAJOR: cfgparse: make sure server names are unique within a backend

There was already a check for this but there used to be an exception
that allowed duplicate server names only in case where their IDs were
explicit and different. This has been emitting a warning since 3.1 and
planned for removal in 3.3, so let's do it now. The doc was updated,
though it never mentioned this unicity constraint, so that was added.

Only the check for the exception was removed, the rest of the code
that is currently made to deal with duplicate server names was not
cleaned yet (e.g. the tree doesn't need to support dups anymore, and
this could be done at insertion time). This may be a subject for future
cleanups.

2 weeks agoMAJOR: cfgparse: turn the same proxy name warning to an error
Willy Tarreau [Mon, 23 Jun 2025 13:26:44 +0000 (15:26 +0200)] 
MAJOR: cfgparse: turn the same proxy name warning to an error

As warned since 3.1, it's no longer permitted to have a frontend and
a backend under the same name. This causes too many designation issues,
and causes trouble with stick-tables as well. Now each proxy name is
unique.

This commit only changes the check to return an error. Some code parts
currently exist to find the best candidates, these will be able to be
simplified as future cleanup patches. The doc was updated.

2 weeks agoBUG/MEDIUM: quic: do not release BE quic-conn prior to upper conn
Amaury Denoyelle [Mon, 16 Jun 2025 08:42:34 +0000 (10:42 +0200)] 
BUG/MEDIUM: quic: do not release BE quic-conn prior to upper conn

For frontend side, quic_conn is only released if MUX wasn't allocated,
either due to handshake abort, in which case upper layer is never
allocated, or after transfer completion when full conn + MUX layers are
already released.

On the backend side, initialization is not performed in the same order.
Indeed, in this case, connection is first instantiated, the nthe
quic_conn is created to execute the handshake, while MUX is still only
allocated on handshake completion. As such, it is not possible anymore
to free immediately quic_conn on handshake failure. Else, this can cause
crash if the connection try to reaccess to its transport layer after
quic_conn release.

Such crash can easily be reproduced in case of connection error to the
QUIC server. Here is an example of an experienced backtrace.

Thread 1 "haproxy" received signal SIGSEGV, Segmentation fault.
  0x0000555555739733 in quic_close (conn=0x55555734c0d0, xprt_ctx=0x5555573a6e50) at src/xprt_quic.c:28
  28              qc->conn = NULL;
  [ ## gdb ## ] bt
  #0  0x0000555555739733 in quic_close (conn=0x55555734c0d0, xprt_ctx=0x5555573a6e50) at src/xprt_quic.c:28
  #1  0x00005555559c9708 in conn_xprt_close (conn=0x55555734c0d0) at include/haproxy/connection.h:162
  #2  0x00005555559c97d2 in conn_full_close (conn=0x55555734c0d0) at include/haproxy/connection.h:206
  #3  0x00005555559d01a9 in sc_detach_endp (scp=0x7fffffffd648) at src/stconn.c:451
  #4  0x00005555559d05b9 in sc_reset_endp (sc=0x55555734bf00) at src/stconn.c:533
  #5  0x000055555598281d in back_handle_st_cer (s=0x55555734adb0) at src/backend.c:2754
  #6  0x000055555588158a in process_stream (t=0x55555734be10, context=0x55555734adb0, state=516) at src/stream.c:1907
  #7  0x0000555555dc31d9 in run_tasks_from_lists (budgets=0x7fffffffdb30) at src/task.c:655
  #8  0x0000555555dc3dd3 in process_runnable_tasks () at src/task.c:889
  #9  0x0000555555a1daae in run_poll_loop () at src/haproxy.c:2865
  #10 0x0000555555a1e20c in run_thread_poll_loop (data=0x5555569d1c00 <ha_thread_info>) at src/haproxy.c:3081
  #11 0x0000555555a1f66b in main (argc=5, argv=0x7fffffffde18) at src/haproxy.c:3671

To fix this, change the condition prior to calling quic_conn release. If
<conn> member is not NULL, delay the release, similarly to the case when
MUX is allocated. This allows connection to be freed first, and detach
from quic_conn layer through close xprt operation.

No need to backport.

2 weeks agoMINOR: fwlc: Factorize code.
Olivier Houchard [Fri, 20 Jun 2025 13:53:27 +0000 (15:53 +0200)] 
MINOR: fwlc: Factorize code.

Always set unusable if we could not use a server, instead of doing it in
each branch

This should be backported to 3.2 after e28e647fef43e5865c87f328832fec7794a423e5
is backported.

2 weeks agoBUG/MAJOR: fwlc: Count an avoided server as unusable.
Olivier Houchard [Fri, 20 Jun 2025 13:06:04 +0000 (15:06 +0200)] 
BUG/MAJOR: fwlc: Count an avoided server as unusable.

When fwlc_get_next_server(), if a server to avoid has been provided, and
we have to ignore it, don't forget to increase the number of unusable
servers, otherwise we may end up ignoring it over and over, never
switching to another server, in an infinite loop until the process gets
killed.
This hopefully fixes Github issues #3004 and #3014.

This should be backported to 3.2.

2 weeks agoMEDIUM: mux-quic: implement attach for new streams on backend side
Amaury Denoyelle [Wed, 18 Jun 2025 07:59:50 +0000 (09:59 +0200)] 
MEDIUM: mux-quic: implement attach for new streams on backend side

Implement attach and avail_streams mux-ops callbacks, which are used on
backend side for connection reuse.

Attach operation is used to initiate new streams on the connection
outside of the first one. It simply relies on qcc_init_stream_local() to
instantiate a new QCS instance, which is immediately linked to its
stream data layer.

Outside of attach, it is also necessary to implement avail_streams so
that the stream layer will try to initiate connection reuse. This method
reports the number of bidirectional streams which can still be opened
for the QUIC connection. It depends directly to the flow-control value
advertised by the peer. Thus, this ensures that attach won't cause any
flow control violation.

2 weeks agoMINOR: mux-quic: abort conn if cannot create stream due to fctl
Amaury Denoyelle [Wed, 18 Jun 2025 14:24:41 +0000 (16:24 +0200)] 
MINOR: mux-quic: abort conn if cannot create stream due to fctl

Prior to initiate first stream on the backend side, ensure that peer
flow-control allows at least that a single bidirectional stream can be
created. If this is not the case, abort MUX init operation.

Before this patch, flow-control limit was not checked. Hence, if peer
does not allow any bidirectional stream, haproxy would violate it, which
whould then cause the peer to close the connection.

Note that with the current situation, haproxy won't be able to talk to
servers which uses a 0 for initial max bidi streams. A proper solution
could be to pause the request until a MAX_STREAMS is received, under
timeout supervision to ensure the connection is closed if no frame is
received.

2 weeks agoMINOR: mux-quic: support max bidi streams value set by the peer
Amaury Denoyelle [Wed, 18 Jun 2025 07:25:39 +0000 (09:25 +0200)] 
MINOR: mux-quic: support max bidi streams value set by the peer

Implement support for MAX_STREAMS frame. On frontend, this was mostly
useless as haproxy would never initiate new bidirectional streams.
However, this becomes necessary to control stream flow-control when
using QUIC as a client on the backend side.

Parsing of MAX_STREAMS is implemented via new qcc_recv_max_streams().
This allows to update <ms_uni>/<ms_bidi> QCC fields.

This patch is necessary to achieve QUIC backend connection reuse.

2 weeks agoBUG/MINOR: mux-quic/h3: properly handle too low peer fctl initial stream
Amaury Denoyelle [Wed, 18 Jun 2025 13:12:31 +0000 (15:12 +0200)] 
BUG/MINOR: mux-quic/h3: properly handle too low peer fctl initial stream

Previously, no check on peer flow-control was implemented prior to open
a local QUIC stream. This was a small problem for frontend
implementation, as in this case haproxy as a server never opens
bidirectional streams.

On frontend, the only stream opened by haproxy in this case is for
HTTP/3 control unidirectional data. If the peer uses an initial value
for max uni streams set to 0, it would violate its flow control, and the
peer will probably close the connection. Note however that RFC 9114
mandates that each peer defines minimal initial value so that at least
the control stream can be created.

This commit improves the situation of too low initial max uni streams
value. Now, on HTTP/3 layer initialization, haproxy preemptively checks
flow control limit on streams via a new function
qcc_fctl_avail_streams(). If credit is already expired due to a too
small initial value, haproxy preemptively closes the connection using
H3_ERR_GENERAL_PROTOCOL_ERROR. This behavior is better as haproxy is now
the initiator of the connection closure.

This should be backported up to 2.8.

2 weeks agoCLEANUP: connection: remove unused mux-ops dedicated to QUIC
Amaury Denoyelle [Tue, 17 Jun 2025 09:49:04 +0000 (11:49 +0200)] 
CLEANUP: connection: remove unused mux-ops dedicated to QUIC

Remove avail_streams_bidi/avail_streams_uni mux_ops. These callbacks
were designed to be specific to QUIC. However, they won't be necessary,
as stream layer only cares about bidirectional streams.

2 weeks agoDOC: config: prefer-last-server: add notes for non-deterministic algorithms
Valentine Krasnobaeva [Tue, 17 Jun 2025 13:33:12 +0000 (13:33 +0000)] 
DOC: config: prefer-last-server: add notes for non-deterministic algorithms

Add some notes which load-balancing algorithm can be considered as
deterministic or non-deterministic and add some examples for each type.
This was asked via mailing list to clarify the usage of
prefer-last-server option.

This can be backported to all stable versions.

2 weeks agoMINOR: h3: reject invalid :status in response
Amaury Denoyelle [Tue, 17 Jun 2025 09:33:53 +0000 (11:33 +0200)] 
MINOR: h3: reject invalid :status in response

Add checks to ensure that :status pseudo-header received in HTTP/3
response is valid. If either the header is not provided, or it isn't a 3
digit numbers, the response is considered as invalid and the streams is
rejected. Also, glitch counter is now incremented in any of these cases.

This should fix coverity report from github issue #3009.

2 weeks agoMINOR: h3: use BUG_ON() on missing request start-line
Amaury Denoyelle [Tue, 17 Jun 2025 08:25:30 +0000 (10:25 +0200)] 
MINOR: h3: use BUG_ON() on missing request start-line

Convert BUG_ON_HOT() statements to BUG_ON() if HTX start-line is either
missing or duplicated when transcoding into a HTTP/3 request. This
ensures that such abnormal conditions will be detected even on default
builds.

This is linked to coverity report #3008.

3 weeks agoMINOR: h3: transcode H3 response headers into HTX blocks
Amaury Denoyelle [Mon, 16 Jun 2025 14:32:57 +0000 (16:32 +0200)] 
MINOR: h3: transcode H3 response headers into HTX blocks

Finalize HTTP/3 response transcoding into HTX message. This patch
implements conversion of HTTP/3 headers provided by the server into HTX
blocks.

Special checks have been implemented to reject connection-specific
headers, causing the stream to be shut in error. Also, handling of
content-length requires that the body size is equal to the value
advertized in the header to prevent HTTP desync.

3 weeks agoMINOR: h3: complete response status transcoding
Amaury Denoyelle [Mon, 16 Jun 2025 14:32:36 +0000 (16:32 +0200)] 
MINOR: h3: complete response status transcoding

On the backend side, HTTP/3 request response from server is transcoded
into a HTX message. Previously, a fixed value was used for the status
code.

Improve this by extracting the value specified by the server and set it
into the HTX status line. This requires to detect :status pseudo-header
from the HTTP/3 response.

3 weeks agoMINOR: h3: convert HTTP/3 response into HTX for backend side support
Amaury Denoyelle [Tue, 10 Jun 2025 15:45:27 +0000 (17:45 +0200)] 
MINOR: h3: convert HTTP/3 response into HTX for backend side support

Implement basic support for HTTP/3 request response transcoding into
HTX. This is done via a new dedicated function h3_resp_headers_to_htx().
A valid HTX status-line is allocated and stored. Status code is
hardcoded to 200 for now.

Following patches will be added to remove hardcoded status value and
also handle response headers provided by the server.