Skip to content

Commit e918c7d

Browse files
authored
Merge pull request #475 from SeverinLeonhardt/openssl_1.1_compat
Reach full compatibility with OpenSSL 1.1
2 parents 2b3fb19 + f83ec7f commit e918c7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ssl/ssl_openssl_impl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,11 @@ void free(void* ptr, const char* file, int line) { Memory::free(ptr); }
620620
void OpenSslContextFactory::internal_init() {
621621
CRYPTO_set_mem_functions(openssl::malloc, openssl::realloc, openssl::free);
622622

623+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
623624
SSL_library_init();
624625
SSL_load_error_strings();
625626
OpenSSL_add_all_algorithms();
627+
#endif
626628

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

656658
void OpenSslContextFactory::internal_cleanup() {
659+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
657660
RAND_cleanup();
658661
ENGINE_cleanup();
662+
#endif
659663
CONF_modules_unload(1);
664+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
660665
CONF_modules_free();
661666
EVP_cleanup();
662667
ERR_free_strings();
663668
CRYPTO_cleanup_all_ex_data();
664669
CRYPTO_set_locking_callback(NULL);
665670
CRYPTO_set_id_callback(NULL);
671+
#endif
666672
#if OPENSSL_VERSION_NUMBER < 0x10100000L && OPENSSL_VERSION_NUMBER > 0x10002000L
667673
SSL_COMP_free_compression_methods();
668674
#endif

0 commit comments

Comments
 (0)