]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: prevent crash on startup with -dt
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 Jun 2025 13:15:56 +0000 (15:15 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 Jun 2025 13:15:56 +0000 (15:15 +0200)
QUIC traces in ssl_quic_srv_new_ssl_ctx() are problematic as this
function is called early during startup. If activating traces via -dt
command-line argument, a crash occurs due to stderr sink not yet
available.

Thus, traces from ssl_quic_srv_new_ssl_ctx() are simply removed.

No backport needed.

src/quic_ssl.c

index 21c4237aa8e17cbaa81d454d1791887d33ea96a6..327a2440262d5c01fbe79e0e9e7d7fa6d5f82b36 100644 (file)
@@ -780,13 +780,9 @@ SSL_CTX *ssl_quic_srv_new_ssl_ctx(void)
                SSL_OP_SINGLE_ECDH_USE |
                SSL_OP_CIPHER_SERVER_PREFERENCE;
 
-       TRACE_ENTER(QUIC_EV_CONN_NEW);
-
        ctx = SSL_CTX_new(TLS_client_method());
-       if (!ctx) {
-               TRACE_ERROR("Could not allocate a new TLS context", QUIC_EV_CONN_NEW);
+       if (!ctx)
                goto err;
-       }
 
        SSL_CTX_set_options(ctx, options);
        SSL_CTX_set_min_proto_version(ctx, TLS1_3_VERSION);
@@ -797,12 +793,10 @@ SSL_CTX *ssl_quic_srv_new_ssl_ctx(void)
 #endif
 
  leave:
-       TRACE_LEAVE(QUIC_EV_CONN_NEW);
        return ctx;
  err:
        SSL_CTX_free(ctx);
        ctx = NULL;
-       TRACE_DEVEL("leaving on error", QUIC_EV_CONN_NEW);
        goto leave;
 }