]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic-be: Set the backend alpn if not set by conf
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 3 Jul 2025 18:53:00 +0000 (20:53 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Mon, 7 Jul 2025 12:13:02 +0000 (14:13 +0200)
Simply set the alpn string to "h3,hq_interop" if there is no "alpn" setting for
QUIC backends.

src/server.c

index c2597091a4e5a7914b78df68a88a417c497650fa..8a0ba8c85987389aeb54c9b4bf76ac4651140511 100644 (file)
@@ -43,6 +43,7 @@
 #include <haproxy/sc_strm.h>
 #include <haproxy/server.h>
 #include <haproxy/stats.h>
+#include <haproxy/ssl_sock.h>
 #include <haproxy/stconn.h>
 #include <haproxy/stream.h>
 #include <haproxy/stress.h>
@@ -3854,6 +3855,12 @@ static int _srv_parse_finalize(char **args, int cur_arg,
                        ha_alert("QUIC protocol detected without explicit SSL requirement. Use 'ssl' to fix this.\n");
                        return ERR_ALERT | ERR_FATAL;
                }
+
+               if (!srv->ssl_ctx.alpn_str &&
+                   ssl_sock_parse_alpn("h3", &srv->ssl_ctx.alpn_str,
+                                       &srv->ssl_ctx.alpn_len, &errmsg) != 0) {
+                       return ERR_ALERT | ERR_FATAL;
+               }
        }
 #endif