1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Check for OPENSSL_NO_ECDH before using ECDH

This commit is contained in:
Ben Vinson 2015-08-12 08:28:01 -06:00
parent 972e8102f5
commit c7cc4e184e

View file

@ -147,11 +147,13 @@ VALUE engine_init_server(VALUE self, VALUE mini_ssl_ctx) {
DH *dh = get_dh1024();
SSL_CTX_set_tmp_dh(ctx, dh);
#ifndef OPENSSL_NO_ECDH
EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
if (ecdh) {
SSL_CTX_set_tmp_ecdh(ctx, ecdh);
EC_KEY_free(ecdh);
}
#endif
ssl = SSL_new(ctx);
conn->ssl = ssl;