From b9722a683752eda81866e38dfa97dd26cc21f51a Mon Sep 17 00:00:00 2001 From: Maverick Chiou <64595809+chiouss@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:58:27 +0800 Subject: [PATCH] Improve OpenSSL API compatibility After OpenSSL 1.1.0, ECDH is always enabled. ( openssl/openssl#1437 ) --- src/tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tls.c b/src/tls.c index efa3b1e1..295e55fc 100644 --- a/src/tls.c +++ b/src/tls.c @@ -153,6 +153,7 @@ static SSL_TICKET_RETURN session_ticket_cb(SSL *tls_ctx, } #endif +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) static int tls_init_ecdh_curve(void) { #ifdef SSL_CTRL_SET_ECDH_AUTO @@ -186,6 +187,7 @@ static int tls_init_ecdh_curve(void) # endif #endif } +#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) */ #ifndef SSL_CTRL_SET_DH_AUTO static int tls_load_dhparams_default(void) @@ -414,7 +416,9 @@ static int tls_create_new_context(const char *cert_file, if (ssl_verify_client_cert) { tls_init_client_cert_verification(cert_file); } +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) tls_init_ecdh_curve(); +#endif tls_init_dhparams(); return 0;