Skip to content

Commit

Permalink
Merge pull request #478 from datastax/usetls1.2
Browse files Browse the repository at this point in the history
Limit to TLS 1.2 (and below)
  • Loading branch information
mpenick authored Jul 17, 2020
2 parents e010b6a + 061cecd commit ee21516
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ssl/ssl_openssl_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ OpenSslSession::OpenSslSession(const Address& address, const String& hostname,
, incoming_bio_(rb::RingBufferBio::create(&incoming_state_))
, outgoing_bio_(rb::RingBufferBio::create(&outgoing_state_)) {
SSL_set_bio(ssl_, incoming_bio_, outgoing_bio_);
#if DEBUG_SSL
SSL_CTX_set_info_callback(ssl_ctx, ssl_info_callback);
#endif
SSL_set_connect_state(ssl_);

if (!sni_server_name_.empty()) {
Expand Down Expand Up @@ -542,6 +539,11 @@ OpenSslContext::OpenSslContext()
, trusted_store_(X509_STORE_new()) {
SSL_CTX_set_cert_store(ssl_ctx_, trusted_store_);
SSL_CTX_set_verify(ssl_ctx_, SSL_VERIFY_NONE, ssl_no_verify_callback);
// Limit to TLS 1.2 for now. TLS 1.3 has broken the handshake code.
SSL_CTX_set_max_proto_version(ssl_ctx_, TLS1_2_VERSION);

This comment has been minimized.

Copy link
@remicollet

remicollet Jul 21, 2020

Contributor

This breaks build on EL-7 which have openssl 1.0.2

/builddir/build/BUILD/cpp-driver-ee2151664314f4efe3d7d00e49677445fe6c8830/src/ssl/ssl_openssl_impl.cpp: In constructor 'datastax::internal::core::OpenSslContext::OpenSslContext()':
/builddir/build/BUILD/cpp-driver-ee2151664314f4efe3d7d00e49677445fe6c8830/src/ssl/ssl_openssl_impl.cpp:543:57: error: 'SSL_CTX_set_max_proto_version' was not declared in this scope
   SSL_CTX_set_max_proto_version(ssl_ctx_, TLS1_2_VERSION);
                                                         ^

#if DEBUG_SSL
SSL_CTX_set_info_callback(ssl_ctx_, ssl_info_callback);
#endif
}

OpenSslContext::~OpenSslContext() { SSL_CTX_free(ssl_ctx_); }
Expand Down

0 comments on commit ee21516

Please sign in to comment.