]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: ssl/quic: mark hq-interop QUIC ALPN as experimental quic-interop
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 Nov 2026 15:19:14 +0000 (16:19 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 20 Nov 2026 11:02:24 +0000 (12:02 +0100)
hq-interop in ALPN corresponds to HTTP/0.9 layer. This protocol is
reserved for QUIC interop testing and must not be active in production.

Introduces a new global keyword 'tune.quic.interop'. It may be set to
either 'fe' or 'off', anticipating a future 'be' value for backend
support. The keyword parsing forces users to activate experimental
directives.

The second part of this patch is in ALPN keyword parsing. If hq-interop
is found but 'tune.quic.interop fe' is not set, an error is reported.
This parser may also run at runtime for dynamic crt-list loading. In
this case, 'hq-interop' token is silently removed if present.

For now, nothing is performed on the server-side. This is because QUIC
backend is still incomplete and is itself experimental.

doc/configuration.txt
include/haproxy/quic_tune-t.h
src/cfgparse-quic.c
src/cfgparse-ssl.c
src/server.c

index 0a3246c3158e009e0050f24f77d068ce9d45a8fd..4edb162efe64cf5c5f6b37129a7a664c229ee9be 100644 (file)
@@ -2033,6 +2033,7 @@ The following keywords are supported in the "global" section :
    - tune.quic.fe.stream.rxbuf
    - tune.quic.fe.tx.pacing
    - tune.quic.fe.tx.udp-gso
+   - tune.quic.interop
    - tune.quic.listen
    - tune.quic.mem.tx-max
    - tune.quic.sec.stateless-reset-rate
@@ -5742,6 +5743,16 @@ tune.quic.fe.tx.udp-gso { on | off }
   be useful to disable it on developers suggestion when suspecting an issue on
   emission.
 
+tune.quic.interop { off | fe } [ EXPERIMENTAL ]
+  Activates support for QUIC interop testing. This is mandatory to be able to
+  use "hq-interop" in ALPN configuration. This must never be activated for
+  normal usage.
+
+  The default value "off" disables QUIC interop testing. The "fe" value is used
+  to run HAProxy as a server in the interop test suite.
+
+  It requires "expose-experimental-directives" to be set.
+
 tune.quic.listen { on | off }
   Disable QUIC transport protocol on the frontend side. All the QUIC listeners
   will still be created, but they won't listen for incoming datagrams. Hence,
@@ -18159,8 +18170,11 @@ alpn <protocols>
 
        bind :443 ssl crt pub.pem alpn h2  # explicitly disable HTTP/1.1
 
-  QUIC supports only h3 and hq-interop as ALPN. h3 is for HTTP/3 and hq-interop
-  is used for http/0.9 and QUIC interop runner (see https://interop.seemann.io).
+  Only "h3" is officially supported as a QUIC ALPN for HTTP/3. The "hq-interop"
+  value is reserved for QUIC interop testing (see https://interop.seemann.io).
+  It cannot be used unless the experimental keyword "tune.quic.interop" is set
+  to the proper value.
+
   Each "alpn" statement will replace a previous one. In order to remove them,
   use "no-alpn".
 
index ea40ba2bb8cdc83aeaa689e36667595fd96bc4de..03717298d5202e3438eac2442fec0df88cd11436 100644 (file)
@@ -33,6 +33,7 @@
 #define QUIC_TUNE_FB_TX_PACING  0x00000001
 #define QUIC_TUNE_FB_TX_UDP_GSO 0x00000002
 #define QUIC_TUNE_FB_CC_HYSTART 0x00000004
+#define QUIC_TUNE_FB_INTEROP    0x00000008
 
 struct quic_tune {
        struct {
index 5a005d206e4dbbe08fc7b9249dd2c0467c07441a..159a24285039f73a1cef57f1624076488627ad24 100644 (file)
@@ -533,7 +533,38 @@ static int cfg_parse_quic_tune_on_off(char **args, int section_type, struct prox
        return ret;
 }
 
+static int cfg_parse_quic_tune_interop(char **args, int section_type, struct proxy *curpx,
+                                       const struct proxy *defpx, const char *file, int line,
+                                       char **err)
+{
+       int ret = 0;
+
+       if (too_many_args(1, args, err, NULL))
+               return -1;
+
+       if (!experimental_directives_allowed) {
+               memprintf(err, "'%s' is experimental, must be allowed via a global "
+                              "'expose-experimental-directives'.", args[0]);
+               return -1;
+       }
+       mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED);
+
+       if (strcmp(args[1], "fe") == 0) {
+               quic_tune.fe.fb_opts |= QUIC_TUNE_FB_INTEROP;
+       }
+       else if (strcmp(args[1], "off") == 0) {
+               quic_tune.fe.fb_opts &= ~QUIC_TUNE_FB_INTEROP;
+       }
+       else {
+               memprintf(err, "'%s' expects 'fe' or 'off'.", args[0]);
+               return -1;
+       }
+
+       return ret;
+}
+
 static struct cfg_kw_list cfg_kws = {ILH, {
+       { CFG_GLOBAL, "tune.quic.interop", cfg_parse_quic_tune_interop },
        { CFG_GLOBAL, "tune.quic.listen", cfg_parse_quic_tune_on_off },
        { CFG_GLOBAL, "tune.quic.mem.tx-max", cfg_parse_quic_tune_setting },
        { CFG_GLOBAL, "tune.quic.sec.stateless-reset-rate", cfg_parse_quic_tune_setting },
index 55a3b3df82eb2836f3b0bf98260db1877ff5c67e..2e4e6770ff5352e18515d65ef427385808fe9748 100644 (file)
@@ -39,6 +39,7 @@
 #include <haproxy/listener.h>
 #include <haproxy/openssl-compat.h>
 #include <haproxy/quic_ssl-t.h>
+#include <haproxy/quic_tune.h>
 #include <haproxy/ssl_sock.h>
 #include <haproxy/ssl_utils.h>
 #include <haproxy/tools.h>
@@ -1433,10 +1434,25 @@ static int ssl_bind_parse_alpn(char **args, int cur_arg, struct proxy *px, struc
        free(conf->alpn_str);
 
        ret = ssl_sock_parse_alpn(args[cur_arg + 1], &conf->alpn_str, &conf->alpn_len, err);
-       if (ret)
+       if (ret) {
                memprintf(err, "'%s' : %s", args[cur_arg], *err);
-       else if (global.tune.options2 & GTUNE2_DISABLE_H2_FE)
-               alpn_remove_token(conf->alpn_str, &conf->alpn_len, ist("h2"), 0);
+       }
+       else {
+               if (global.tune.options2 & GTUNE2_DISABLE_H2_FE)
+                       alpn_remove_token(conf->alpn_str, &conf->alpn_len, ist("h2"), 0);
+
+#ifdef USE_QUIC
+               if (!(quic_tune.fe.fb_opts & QUIC_TUNE_FB_INTEROP)) {
+                       if (alpn_remove_token(conf->alpn_str, &conf->alpn_len, ist("hq-interop"), 1)) {
+                               if (!from_cli) {
+                                       memprintf(err, "'hq-interop' found in ALPN, forbidden unless QUIC interop testing is active.\n");
+                                       ret |= ERR_ALERT | ERR_FATAL;
+                               }
+                       }
+               }
+#endif /* USE_QUIC */
+       }
+
        return ret;
 #else
        memprintf(err, "'%s' : library does not support TLS ALPN extension", args[cur_arg]);
index 5ffc112d5610919bede2d996172778b01e6d154d..86efa9c1f4392e7a4e1333045fa8d9e27aa71c51 100644 (file)
@@ -3892,7 +3892,9 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg,
                if (srv_is_quic(newsrv)) {
                        /* TODO QUIC is currently incompatible with dynamic
                         * backends deletion. Please fix this before removing
-                        * QUIC BE experimental status.
+                        * QUIC BE experimental status. When this is done,
+                        * ensures "hq-interop" remains gated behind the
+                        * experimental status.
                         */
                        if (!experimental_directives_allowed) {
                                ha_alert("QUIC is experimental for server '%s',"