From: Remi Gacogne Date: Tue, 21 Jan 2020 14:00:01 +0000 (+0100) Subject: dnsdist: Load an openssl configuration file, if any, during startup X-Git-Tag: auth-4.3.0-beta1~20^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81fe6363391bddb38be1626eb5bf92da2ea61f58;p=thirdparty%2Fpdns.git dnsdist: Load an openssl configuration file, if any, during startup This way dnsdist will load the default OpenSSL configuration, or a custom one specified via the OPENSSL_CONF environment variable. It allows loading an engine or configuration various options supported by OpenSSL. This requires OpenSSL >= 1.1.0. --- diff --git a/pdns/dnsdistdist/libssl.cc b/pdns/dnsdistdist/libssl.cc index ee9b9ef0fc..41c90bbd91 100644 --- a/pdns/dnsdistdist/libssl.cc +++ b/pdns/dnsdistdist/libssl.cc @@ -72,7 +72,11 @@ static int s_keyLogIndex{-1}; void registerOpenSSLUser() { if (s_users.fetch_add(1) == 0) { -#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER) +#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL && !defined LIBRESSL_VERSION_NUMBER) + /* load the default configuration file (or one specified via OPENSSL_CONF), + which can then be used to load engines */ + OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, nullptr); +#else /* (OPENSSL_VERSION_NUMBER < 0x1010000fL || defined LIBRESSL_VERSION_NUMBER) */ SSL_load_error_strings(); OpenSSL_add_ssl_algorithms(); openssl_thread_setup();