ssl: Stop using deprecated Openssl APIs, by neheb.

This commit is contained in:
Nick Peng
2020-01-21 22:48:02 +08:00
parent aa7237f770
commit 2322a9dbd0
2 changed files with 6 additions and 2 deletions

View File

@@ -222,20 +222,22 @@ static int _smartdns_set_ecs_ip(void)
static int _smartdns_init_ssl(void)
{
#if OPENSSL_API_COMPAT < 0x10100000L
SSL_load_error_strings();
SSL_library_init();
OpenSSL_add_all_algorithms();
SSL_CRYPTO_thread_setup();
#endif
return 0;
}
static int _smartdns_destroy_ssl(void)
{
#if OPENSSL_API_COMPAT < 0x10100000L
SSL_CRYPTO_thread_cleanup();
ERR_free_strings();
EVP_cleanup();
#endif
return 0;
}

View File

@@ -687,6 +687,7 @@ errout:
return -1;
}
#if OPENSSL_API_COMPAT < 0x10100000
#define THREAD_STACK_SIZE (16 * 1024)
static pthread_mutex_t *lock_cs;
static long *lock_count;
@@ -743,6 +744,7 @@ void SSL_CRYPTO_thread_cleanup(void)
OPENSSL_free(lock_cs);
OPENSSL_free(lock_count);
}
#endif
#define SERVER_NAME_LEN 256
#define TLS_HEADER_LEN 5