Use different TLS methods for OpenSSL 1.0 and 1.1

This commit is contained in:
ritt 2020-02-11 10:49:34 +01:00
parent 8e6cb6a697
commit c1fd3ee3c3
2 changed files with 13 additions and 1 deletions

View File

@ -304,8 +304,12 @@ int ssl_connect(int sock, SSL ** ssl_con)
SSL_library_init();
SSL_load_error_strings();
#if OPENSSL_VERSION_NUMBER > 0x1010000fL
meth = (SSL_METHOD *) TLS_method();
#else
meth = (SSL_METHOD *) TLSv1_2_method();
#endif
ctx = SSL_CTX_new(meth);
*ssl_con = SSL_new(ctx);

View File

@ -2457,7 +2457,11 @@ int ssl_connect(int sock, SSL **ssl_con) {
SSL_library_init();
SSL_load_error_strings();
#if OPENSSL_VERSION_NUMBER > 0x1010000fL
meth = (SSL_METHOD *) TLS_method();
#else
meth = (SSL_METHOD *) TLSv1_2_method();
#endif
ctx = SSL_CTX_new(meth);
*ssl_con = SSL_new(ctx);
@ -29508,7 +29512,11 @@ SSL_CTX *init_ssl(void) {
SSL_library_init();
SSL_load_error_strings();
#if OPENSSL_VERSION_NUMBER > 0x1010000fL
meth = (SSL_METHOD *) TLS_method();
#else
meth = (SSL_METHOD *) TLSv1_2_method();
#endif
ctx = SSL_CTX_new(meth);
if (getcfg("global", "SSL Passphrase", pwd, sizeof(pwd))) {