Commit 6ce9e5a1 authored by Johanna Amann's avatar Johanna Amann

Fix OpenSSL 3 warning for curve selection

It turns out that the new API was only introduced with OpenSSL 1.1.1 -
so this sadly gets another ifdef.
parent 459ba92b
...@@ -231,7 +231,17 @@ SSL_CTX* session::create_ssl_context() { ...@@ -231,7 +231,17 @@ SSL_CTX* session::create_ssl_context() {
#if defined(CAF_SSL_HAS_ECDH_AUTO) && (OPENSSL_VERSION_NUMBER < 0x10100000L) #if defined(CAF_SSL_HAS_ECDH_AUTO) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
SSL_CTX_set_ecdh_auto(ctx, 1); SSL_CTX_set_ecdh_auto(ctx, 1);
#else #else
#if OPENSSL_VERSION_NUMBER < 0x10101000L
auto ecdh = EC_KEY_new_by_curve_name(NID_secp384r1);
if (!ecdh)
CAF_RAISE_ERROR("cannot get ECDH curve");
CAF_PUSH_WARNINGS
SSL_CTX_set_tmp_ecdh(ctx, ecdh);
EC_KEY_free(ecdh);
CAF_POP_WARNINGS
#else /* OPENSSL_VERSION_NUMBER < 0x10101000L */
SSL_CTX_set1_groups_list(ctx, "P-384"); SSL_CTX_set1_groups_list(ctx, "P-384");
#endif /* OPENSSL_VERSION_NUMBER < 0x10101000L */
#endif #endif
#ifdef CAF_SSL_HAS_SECURITY_LEVEL #ifdef CAF_SSL_HAS_SECURITY_LEVEL
const char* cipher = "AECDH-AES256-SHA@SECLEVEL=0"; const char* cipher = "AECDH-AES256-SHA@SECLEVEL=0";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment