]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: quic: missing app ops init during backend 0-RTT sessions
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 24 Feb 2026 18:22:50 +0000 (19:22 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 25 Feb 2026 10:13:52 +0000 (11:13 +0100)
commit89c75b07774e75d33a82a13400f33cdafbde9151
tree99956c9e74e8c91aa7406cd06a2b1a2942199ee2
parent84837b6e70d8322c144d7f16e21267827668f2be
BUG/MINOR: quic: missing app ops init during backend 0-RTT sessions

The QUIC mux requires "application operations" (app ops), which are a list
of callbacks associated with the application level (i.e., h3, h0.9) and
derived from the ALPN. For 0-RTT, when the session cache cannot be reused
before activation, the current code fails to reach the initialization of
these app ops, causing the mux to crash during its initialization.

To fix this, this patch restores the behavior of
ssl_sock_srv_try_reuse_sess(), whose purpose was to reuse sessions stored
in the session cache regardless of whether 0-RTT was enabled, prior to
this commit:

  MEDIUM: quic-be: modify ssl_sock_srv_try_reuse_sess() to reuse backend
  sessions (0-RTT)

With this patch, this function now does only one thing: attempt to reuse a
session, and that's it!

This patch allows ignoring whether a session was successfully reused from
the cache or not. This directly fixes the issue where app ops
initialization was skipped upon a session cache reuse failure. From a
functional standpoint, starting a mux without reusing the session cache
has no negative impact; the mux will start, but with no early data to
send.

Finally, there is the case where the ALPN is reset when the backend is
stopped. It is critical to continue locking read access to the ALPN to
secure shared access, which this patch does. It is indeed possible for the
server to be stopped between the call to connect_server() and
quic_reuse_srv_params(). But this cannot prevent the mux to start
without app ops. This is why a 'TODO' section was added, as a reminder that a
race condition regarding the ALPN reset still needs to be fixed.

Must be backported to 3.3
include/haproxy/ssl_sock.h
src/quic_conn.c
src/quic_ssl.c
src/ssl_sock.c