Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ssl/ssl_openssl_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,11 @@ void free(void* ptr, const char* file, int line) { Memory::free(ptr); }
void OpenSslContextFactory::internal_init() {
CRYPTO_set_mem_functions(openssl::malloc, openssl::realloc, openssl::free);

#if OPENSSL_VERSION_NUMBER < 0x10100000L
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move these init. functions into the #ifdef block below (starting at line 629)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not. I don't think this will work for libressl.

SSL_library_init();
SSL_load_error_strings();
OpenSSL_add_all_algorithms();
#endif

#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
// We have to set the lock/id callbacks for use of OpenSSL thread safety.
Expand Down Expand Up @@ -654,15 +656,19 @@ void OpenSslContextFactory::internal_thread_cleanup() {
}

void OpenSslContextFactory::internal_cleanup() {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
RAND_cleanup();
ENGINE_cleanup();
#endif
CONF_modules_unload(1);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
CONF_modules_free();
EVP_cleanup();
ERR_free_strings();
CRYPTO_cleanup_all_ex_data();
CRYPTO_set_locking_callback(NULL);
CRYPTO_set_id_callback(NULL);
#endif
#if OPENSSL_VERSION_NUMBER < 0x10100000L && OPENSSL_VERSION_NUMBER > 0x10002000L
SSL_COMP_free_compression_methods();
#endif
Expand Down