Commit 7fabe818 authored by Mingtao Yang's avatar Mingtao Yang Committed by Facebook Github Bot

SSLContext: Disable TLSv1.3 support by default

Summary:
OpenSSL 1.1.1 adds TLSv1.3 support, but changes several semantics (e.g.
assumptions on SSL_get_session() returning resumable sessions) that require
some work to address. A lot of our AsyncSocket tests fail (e.g. tests for
resumption will automatically fail, since TLSv1.3 has no resumption support),
and would need to be updated to explicitly disable TLSv1.3.

The plan is to eventually remove this after these items are addressed.

Reviewed By: yfeldblum

Differential Revision: D14073093

fbshipit-source-id: 181b05395ed35aaa7deb00b8968ff4d371b683f4
parent e03e7630
......@@ -57,6 +57,16 @@ SSLContext::SSLContext(SSLVersion version) {
// do nothing
break;
}
// Disable TLS 1.3 by default, for now, if this version of OpenSSL
// supports it. There are some semantic differences (e.g. assumptions
// on getSession() returning a resumable session, SSL_CTX_set_ciphersuites,
// etc.)
//
#if FOLLY_OPENSSL_HAS_TLS13
opt |= SSL_OP_NO_TLSv1_3;
#endif
int newOpt = SSL_CTX_set_options(ctx_, opt);
DCHECK((newOpt & opt) == opt);
......
......@@ -82,6 +82,13 @@
#define FOLLY_OPENSSL_HAS_ALPN 0
#endif
// OpenSSL 1.1.1 and above have TLS 1.3 support
#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
#define FOLLY_OPENSSL_HAS_TLS13 1
#else
#define FOLLY_OPENSSL_HAS_TLS13 0
#endif
// This attempts to "unify" the OpenSSL libcrypto/libssl APIs between
// OpenSSL 1.0.2, 1.1.0 (and some earlier versions) and BoringSSL. The general
// idea is to provide namespaced wrapper methods for versions which do not
......
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