File tree 6 files changed +35
-0
lines changed
6 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,15 @@ added: v12.0.0
586
586
Set default [ ` tls.DEFAULT_MIN_VERSION ` ] [ ] to 'TLSv1.1'. Use for compatibility
587
587
with old TLS clients or servers.
588
588
589
+ ### ` --tls-min-v1.2 `
590
+ <!-- YAML
591
+ added: REPLACEME
592
+ -->
593
+
594
+ Set default [ ` tls.DEFAULT_MIN_VERSION ` ] [ ] to 'TLSv1.2'. This is the default for
595
+ 12.x and later, but the option is supported for compatibility with older Node.js
596
+ versions.
597
+
589
598
### ` --tls-min-v1.3 `
590
599
<!-- YAML
591
600
added: v12.0.0
Original file line number Diff line number Diff line change @@ -278,6 +278,10 @@ or servers.
278
278
Set default minVersion to 'TLSv1.1'. Use for compatibility with old TLS clients
279
279
or servers.
280
280
.
281
+ .It Fl -tls-min-v1.2
282
+ Set default minVersion to 'TLSv1.2'. This is the default for 12.x and later,
283
+ but the option is supported for compatibility with older Node.js versions.
284
+ .
281
285
.It Fl -tls-min-v1.3
282
286
Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
283
287
favour of TLSv1.3, which is more secure.
Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ if (getOptionValue('--tls-min-v1.0'))
60
60
exports . DEFAULT_MIN_VERSION = 'TLSv1' ;
61
61
else if ( getOptionValue ( '--tls-min-v1.1' ) )
62
62
exports . DEFAULT_MIN_VERSION = 'TLSv1.1' ;
63
+ else if ( getOptionValue ( '--tls-min-v1.2' ) )
64
+ exports . DEFAULT_MIN_VERSION = 'TLSv1.2' ;
63
65
else if ( getOptionValue ( '--tls-min-v1.3' ) )
64
66
exports . DEFAULT_MIN_VERSION = 'TLSv1.3' ;
65
67
else
Original file line number Diff line number Diff line change @@ -433,6 +433,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
433
433
" set default TLS minimum to TLSv1.1 (default: TLSv1.2)" ,
434
434
&EnvironmentOptions::tls_min_v1_1,
435
435
kAllowedInEnvironment );
436
+ AddOption (" --tls-min-v1.2" ,
437
+ " set default TLS minimum to TLSv1.2 (default: TLSv1.2)" ,
438
+ &EnvironmentOptions::tls_min_v1_2,
439
+ kAllowedInEnvironment );
436
440
AddOption (" --tls-min-v1.3" ,
437
441
" set default TLS minimum to TLSv1.3 (default: TLSv1.2)" ,
438
442
&EnvironmentOptions::tls_min_v1_3,
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ class EnvironmentOptions : public Options {
134
134
135
135
bool tls_min_v1_0 = false ;
136
136
bool tls_min_v1_1 = false ;
137
+ bool tls_min_v1_2 = false ;
137
138
bool tls_min_v1_3 = false ;
138
139
bool tls_max_v1_2 = false ;
139
140
bool tls_max_v1_3 = false ;
Original file line number Diff line number Diff line change
1
+ // Flags: --tls-min-v1.2
2
+ 'use strict' ;
3
+ const common = require ( '../common' ) ;
4
+ if ( ! common . hasCrypto ) common . skip ( 'missing crypto' ) ;
5
+
6
+ // Check that node `--tls-min-v1.2` is supported.
7
+
8
+ const assert = require ( 'assert' ) ;
9
+ const tls = require ( 'tls' ) ;
10
+
11
+ assert . strictEqual ( tls . DEFAULT_MAX_VERSION , 'TLSv1.3' ) ;
12
+ assert . strictEqual ( tls . DEFAULT_MIN_VERSION , 'TLSv1.2' ) ;
13
+
14
+ // Check the min-max version protocol versions against these CLI settings.
15
+ require ( './test-tls-min-max-version.js' ) ;
You can’t perform that action at this time.
0 commit comments