Compile with old OpenSSL

pull/311/head
Tatsuhiro Tsujikawa 2014-12-05 22:43:16 +09:00
parent 6d3bd60905
commit 62fba76666
1 changed files with 6 additions and 0 deletions

View File

@ -102,7 +102,9 @@ OpenSSLTLSContext::OpenSSLTLSContext(TLSSessionSide side)
}
// Disable SSLv2/3 and enable all workarounds for buggy servers
SSL_CTX_set_options(sslCtx_, SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3
#ifdef SSL_OP_SINGLE_ECDH_USE
| SSL_OP_SINGLE_ECDH_USE
#endif // SSL_OP_SINGLE_ECDH_USE
#ifdef SSL_OP_NO_COMPRESSION
| SSL_OP_NO_COMPRESSION
#endif // SSL_OP_NO_COMPRESSION
@ -119,6 +121,8 @@ OpenSSLTLSContext::OpenSSLTLSContext(TLSSessionSide side)
ERR_error_string(ERR_get_error(), nullptr)));
}
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
#ifndef OPENSSL_NO_ECDH
auto ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
if(ecdh == nullptr) {
A2_LOG_WARN(fmt("Failed to enable ECDHE cipher suites. Cause: %s",
@ -127,6 +131,8 @@ OpenSSLTLSContext::OpenSSLTLSContext(TLSSessionSide side)
SSL_CTX_set_tmp_ecdh(sslCtx_, ecdh);
EC_KEY_free(ecdh);
}
#endif // OPENSSL_NO_ECDH
#endif // OPENSSL_VERSION_NUMBER >= 0x0090800fL
}
OpenSSLTLSContext::~OpenSSLTLSContext()