]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: haterm: do not try to bind to SSL when not built in
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Jun 2026 16:57:05 +0000 (18:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 2 Jun 2026 16:57:05 +0000 (18:57 +0200)
When built without USE_OPENSSL, the binding errors are dirty, speaking
about crt-store and stuff like this. Better just indicate that SSL
support was not built in and explain how to enable it.

src/haterm_init.c

index 623fe36f778f4d03b6499830dc075270f0afb64e..ad28ad81aa44086944bdf0b5f27852c4b5ff215b 100644 (file)
@@ -404,6 +404,7 @@ void haproxy_init_args(int argc, char **argv)
                                                     tcp_bind_opt ? tcp_bind_opt : "");
                                has_bind = 1;
                                if (port2) {
+#if defined(USE_OPENSSL)
                                        has_ssl = 1;
 
                                        /* SSL/TCP binding */
@@ -415,7 +416,7 @@ void haproxy_init_args(int argc, char **argv)
                                                     tcp_bind_opt ? " " : "",
                                                     tcp_bind_opt ? tcp_bind_opt : "");
 
-#if defined(USE_QUIC)
+# if defined(USE_QUIC)
                                        /* QUIC binding */
                                        hbuf_appendf(&fbuf, "\tbind %s@%s:%s shards by-thread ssl"
                                                     " crt " HATERM_RSA_CERT_NAME
@@ -423,7 +424,11 @@ void haproxy_init_args(int argc, char **argv)
                                                     ipv6 ? "quic6" : "quic4", ip, port2,
                                                     quic_bind_opt ? " " : "",
                                                     quic_bind_opt ? quic_bind_opt : "");
-#endif
+# endif /* USE_QUIC */
+#else /* !USE_OPENSSL */
+                                               ha_alert("SSL support not compiled in. Rebuild with USE_OPENSSL=1.\n");
+                                               goto leave;
+#endif /* USE_OPENSSL */
                                }
                        }
                        else