BUG/MINOR: ssl: initialize WolfSSL before parsing

The wolfSSL library need to be initialized before parsing the
configuration which uses some SSL functions.

To be backported in 2.6.
This commit is contained in:
William Lallemand 2022-12-02 17:17:43 +01:00
parent 44c80ce5b3
commit 151dbbe778

View File

@ -1932,12 +1932,18 @@ static void init(int argc, char **argv)
struct pre_check_fct *prcf; struct pre_check_fct *prcf;
int ideal_maxconn; int ideal_maxconn;
#if defined(USE_OPENSSL) && (HA_OPENSSL_VERSION_NUMBER < 0x1010000fL) #ifdef USE_OPENSSL
#ifdef USE_OPENSSL_WOLFSSL
wolfSSL_Init();
wolfSSL_Debugging_ON();
#endif
#if (HA_OPENSSL_VERSION_NUMBER < 0x1010000fL)
/* Initialize the error strings of OpenSSL /* Initialize the error strings of OpenSSL
* It only needs to be done explicitly with older versions of the SSL * It only needs to be done explicitly with older versions of the SSL
* library. On newer versions, errors strings are loaded during start * library. On newer versions, errors strings are loaded during start
* up. */ * up. */
SSL_load_error_strings(); SSL_load_error_strings();
#endif
#endif #endif
startup_logs_init(); startup_logs_init();
@ -2308,11 +2314,6 @@ static void init(int argc, char **argv)
} }
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
#ifdef USE_OPENSSL_WOLFSSL
wolfSSL_Init();
wolfSSL_Debugging_ON();
#endif
/* Initialize SSL random generator. Must be called before chroot for /* Initialize SSL random generator. Must be called before chroot for
* access to /dev/urandom, and before ha_random_boot() which may use * access to /dev/urandom, and before ha_random_boot() which may use