Skip to content

Commit 77cf877

Browse files
sam-githubBethGriggs
authored andcommitted
tls: re-define max supported version as 1.2
Several secureProtocol strings allow any supported TLS version as the maximum, but our maximum supported protocol version is TLSv1.2 even if someone configures a build against an OpenSSL that supports TLSv1.3. Fixes: #24658 PR-URL: #25024 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 56c6686 commit 77cf877

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/node_crypto.cc

+6
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,12 @@ void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
484484
SSL_SESS_CACHE_NO_AUTO_CLEAR);
485485

486486
SSL_CTX_set_min_proto_version(sc->ctx_.get(), min_version);
487+
488+
if (max_version == 0) {
489+
// Selecting some secureProtocol methods allows the TLS version to be "any
490+
// supported", but we don't support TLSv1.3, even if OpenSSL does.
491+
max_version = TLS1_2_VERSION;
492+
}
487493
SSL_CTX_set_max_proto_version(sc->ctx_.get(), max_version);
488494
// OpenSSL 1.1.0 changed the ticket key size, but the OpenSSL 1.0.x size was
489495
// exposed in the public API. To retain compatibility, install a callback

0 commit comments

Comments
 (0)