Skip to content

Commit 1b1db2d

Browse files
committed
crypto: don't disable TLS 1.3 without suites
In the manual page, there is a stement that ciphersuites contain explicit default settings - all TLS 1.3 ciphersuites are available. In node, we assume that an empty setting mean no ciphersuites and we disable TLS 1.3. A correct approach to disabling TLS 1.3 is to disable TLS 1.3 and by not override the default ciphersuits with an empty string. So, only override OpenSSL's TLS 1.3 ciphersuites with an explicit list of ciphers. If none are acceptible, the correct approach is to disable TLS 1.3 instead elsewhere. Fixes: #43419
1 parent 3d0a0b6 commit 1b1db2d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/internal/tls/secure-context.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,10 @@ function configSecureContext(context, options = kEmptyObject, name = 'options')
225225
cipherSuites,
226226
} = processCiphers(ciphers, `${name}.ciphers`);
227227

228-
context.setCipherSuites(cipherSuites);
228+
if (cipherSuites !== '')
229+
context.setCipherSuites(cipherSuites);
229230
context.setCiphers(cipherList);
230231

231-
if (cipherSuites === '' &&
232-
context.getMaxProto() > TLS1_2_VERSION &&
233-
context.getMinProto() < TLS1_3_VERSION) {
234-
context.setMaxProto(TLS1_2_VERSION);
235-
}
236-
237232
if (cipherList === '' &&
238233
context.getMinProto() < TLS1_3_VERSION &&
239234
context.getMaxProto() > TLS1_2_VERSION) {

0 commit comments

Comments
 (0)