1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Avoid warning about missing legacy provider unless debugging. Fixes #2532

This commit is contained in:
dmiller
2022-09-29 22:19:27 +00:00
parent b5dd2956dd
commit 9d0e5ac2b9
2 changed files with 9 additions and 5 deletions

View File

@@ -118,13 +118,15 @@ SSL_CTX *setup_ssl_listen(void)
ERR_load_crypto_strings(); ERR_load_crypto_strings();
SSL_load_error_strings(); SSL_load_error_strings();
#elif OPENSSL_VERSION_NUMBER >= 0x30000000L #elif OPENSSL_VERSION_NUMBER >= 0x30000000L
if (NULL == OSSL_PROVIDER_load(NULL, "legacy")) if (NULL == OSSL_PROVIDER_load(NULL, "legacy") && o.debug)
{ {
loguser("OpenSSL legacy provider failed to load.\n"); loguser("OpenSSL legacy provider failed to load: %s",
ERR_error_string(ERR_get_error(), NULL));
} }
if (NULL == OSSL_PROVIDER_load(NULL, "default")) if (NULL == OSSL_PROVIDER_load(NULL, "default"))
{ {
loguser("OpenSSL default provider failed to load.\n"); loguser("OpenSSL default provider failed to load: %s",
ERR_error_string(ERR_get_error(), NULL));
} }
#endif #endif

View File

@@ -123,11 +123,13 @@ static SSL_CTX *ssl_init_helper(const SSL_METHOD *method) {
#if OPENSSL_VERSION_NUMBER >= 0x30000000L #if OPENSSL_VERSION_NUMBER >= 0x30000000L
if (NULL == OSSL_PROVIDER_load(NULL, "legacy")) if (NULL == OSSL_PROVIDER_load(NULL, "legacy"))
{ {
nsock_log_error("OpenSSL legacy provider failed to load.\n"); nsock_log_info("OpenSSL legacy provider failed to load: %s",
ERR_error_string(ERR_get_error(), NULL));
} }
if (NULL == OSSL_PROVIDER_load(NULL, "default")) if (NULL == OSSL_PROVIDER_load(NULL, "default"))
{ {
nsock_log_error("OpenSSL default provider failed to load.\n"); nsock_log_error("OpenSSL default provider failed to load: %s",
ERR_error_string(ERR_get_error(), NULL));
} }
#endif #endif
#endif #endif