File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -586,6 +586,15 @@ added: v12.0.0
586586Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.1'. Use for compatibility
587587with old TLS clients or servers.
588588
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+
589598### `--tls-min-v1.3`
590599<!-- YAML
591600added: v12.0.0
Original file line number Diff line number Diff line change @@ -278,6 +278,10 @@ or servers.
278278Set default minVersion to 'TLSv1.1'. Use for compatibility with old TLS clients
279279or servers.
280280.
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+ .
281285.It Fl -tls-min-v1.3
282286Set default minVersion to 'TLSv1.3'. Use to disable support for TLSv1.2 in
283287favour 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'))
6060 exports.DEFAULT_MIN_VERSION = 'TLSv1';
6161else if (getOptionValue('--tls-min-v1.1'))
6262 exports.DEFAULT_MIN_VERSION = 'TLSv1.1';
63+ else if (getOptionValue('--tls-min-v1.2'))
64+ exports.DEFAULT_MIN_VERSION = 'TLSv1.2';
6365else if (getOptionValue('--tls-min-v1.3'))
6466 exports.DEFAULT_MIN_VERSION = 'TLSv1.3';
6567else
Original file line number Diff line number Diff line change @@ -433,6 +433,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
433433 "set default TLS minimum to TLSv1.1 (default: TLSv1.2)",
434434 &EnvironmentOptions::tls_min_v1_1,
435435 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);
436440 AddOption("--tls-min-v1.3",
437441 "set default TLS minimum to TLSv1.3 (default: TLSv1.2)",
438442 &EnvironmentOptions::tls_min_v1_3,
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ class EnvironmentOptions : public Options {
134134
135135 bool tls_min_v1_0 = false;
136136 bool tls_min_v1_1 = false;
137+ bool tls_min_v1_2 = false;
137138 bool tls_min_v1_3 = false;
138139 bool tls_max_v1_2 = false;
139140 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