diff --git a/core/ssl.c b/core/ssl.c index c9c18452..8fa519fb 100644 --- a/core/ssl.c +++ b/core/ssl.c @@ -245,17 +245,19 @@ SSL_CTX *uwsgi_ssl_new_server_context(char *name, char *crt, char *key, char *ci if (dh) { SSL_CTX_set_tmp_dh(ctx, dh); DH_free(dh); + } + } #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #ifndef OPENSSL_NO_ECDH #ifdef NID_X9_62_prime256v1 - EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); - SSL_CTX_set_tmp_ecdh(ctx, ecdh); - EC_KEY_free(ecdh); -#endif -#endif -#endif - } + EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + if (ecdh) { + SSL_CTX_set_tmp_ecdh(ctx, ecdh); + EC_KEY_free(ecdh); } +#endif +#endif +#endif if (crt_need_free) free(crt);