]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: initialize SSL error before parsing
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 2 Dec 2022 16:06:59 +0000 (17:06 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 2 Dec 2022 16:10:11 +0000 (17:10 +0100)
The SSL error initialization need to be done before the configuration
parsing, because it uses the SSL.

Need to be backported to 2.6.

src/haproxy.c

index 822e059ee9ba794d6972ad8602cede722b19673f..7c1add8f6bffa3a173f574d9d4f25cfe933d8731 100644 (file)
@@ -1932,6 +1932,14 @@ static void init(int argc, char **argv)
        struct pre_check_fct *prcf;
        int ideal_maxconn;
 
+#if defined(USE_OPENSSL) && (HA_OPENSSL_VERSION_NUMBER < 0x1010000fL)
+       /* Initialize the error strings of OpenSSL
+        * It only needs to be done explicitly with older versions of the SSL
+        * library. On newer versions, errors strings are loaded during start
+        * up. */
+       SSL_load_error_strings();
+#endif
+
        startup_logs_init();
 
        if (!init_trash_buffers(1)) {
@@ -2305,13 +2313,6 @@ static void init(int argc, char **argv)
         wolfSSL_Debugging_ON();
 #endif
 
-#if (HA_OPENSSL_VERSION_NUMBER < 0x1010000fL)
-       /* Initialize the error strings of OpenSSL
-        * It only needs to be done explicitly with older versions of the SSL
-        * library. On newer versions, errors strings are loaded during start
-        * up. */
-       SSL_load_error_strings();
-#endif
 
        /* Initialize SSL random generator. Must be called before chroot for
         * access to /dev/urandom, and before ha_random_boot() which may use