mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-29 04:04:29 +00:00
Use different TLS methods for OpenSSL 1.0 and 1.1
This commit is contained in:
parent
8e6cb6a697
commit
c1fd3ee3c3
@ -304,8 +304,12 @@ int ssl_connect(int sock, SSL ** ssl_con)
|
|||||||
|
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x1010000fL
|
||||||
meth = (SSL_METHOD *) TLS_method();
|
meth = (SSL_METHOD *) TLS_method();
|
||||||
|
#else
|
||||||
|
meth = (SSL_METHOD *) TLSv1_2_method();
|
||||||
|
#endif
|
||||||
ctx = SSL_CTX_new(meth);
|
ctx = SSL_CTX_new(meth);
|
||||||
|
|
||||||
*ssl_con = SSL_new(ctx);
|
*ssl_con = SSL_new(ctx);
|
||||||
|
|||||||
@ -2457,7 +2457,11 @@ int ssl_connect(int sock, SSL **ssl_con) {
|
|||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x1010000fL
|
||||||
meth = (SSL_METHOD *) TLS_method();
|
meth = (SSL_METHOD *) TLS_method();
|
||||||
|
#else
|
||||||
|
meth = (SSL_METHOD *) TLSv1_2_method();
|
||||||
|
#endif
|
||||||
ctx = SSL_CTX_new(meth);
|
ctx = SSL_CTX_new(meth);
|
||||||
|
|
||||||
*ssl_con = SSL_new(ctx);
|
*ssl_con = SSL_new(ctx);
|
||||||
@ -29508,7 +29512,11 @@ SSL_CTX *init_ssl(void) {
|
|||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x1010000fL
|
||||||
meth = (SSL_METHOD *) TLS_method();
|
meth = (SSL_METHOD *) TLS_method();
|
||||||
|
#else
|
||||||
|
meth = (SSL_METHOD *) TLSv1_2_method();
|
||||||
|
#endif
|
||||||
ctx = SSL_CTX_new(meth);
|
ctx = SSL_CTX_new(meth);
|
||||||
|
|
||||||
if (getcfg("global", "SSL Passphrase", pwd, sizeof(pwd))) {
|
if (getcfg("global", "SSL Passphrase", pwd, sizeof(pwd))) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user