Commit 459ba92b authored by Johanna Amann's avatar Johanna Amann

Fix OpenSSL 3.0 warning by switching to newer EC-curve API

This switches the way in which the curve for a CTX is selected to a
newer API that should work (at least) with OpenSSL 1.0, 1.1 and 3.0.
parent 5c9d462d
...@@ -231,13 +231,7 @@ SSL_CTX* session::create_ssl_context() { ...@@ -231,13 +231,7 @@ 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
auto ecdh = EC_KEY_new_by_curve_name(NID_secp384r1); SSL_CTX_set1_groups_list(ctx, "P-384");
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
#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