Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
tls: support TLS min/max protocol defaults in CLI
Backport CLI switches for default TLS versions: - `--tls-max-v1.2` - `--tls-min-v1.0` - `--tls-min-v1.1` - `--tls-min-v1.2` PR-URL: #27946 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
- Loading branch information
Showing
with
174 additions
and 10 deletions.
- +32 −0 doc/api/cli.md
- +5 −1 doc/api/tls.md
- +16 −0 doc/node.1
- +14 −3 lib/tls.js
- +17 −0 src/node_options.cc
- +4 −0 src/node_options.h
- +1 −1 test/parallel/test-process-env-allowed-flags.js
- +15 −0 test/parallel/test-tls-cli-max-version-1.2.js
- +15 −0 test/parallel/test-tls-cli-min-version-1.0.js
- +15 −0 test/parallel/test-tls-cli-min-version-1.1.js
- +15 −0 test/parallel/test-tls-cli-min-version-1.2.js
- +25 −5 test/parallel/test-tls-min-max-version.js
There are no files selected for viewing
| @@ -0,0 +1,15 @@ | ||
| // Flags: --tls-max-v1.2 | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
| if (!common.hasCrypto) common.skip('missing crypto'); | ||
|
|
||
| // Check that node `--tls-max-v1.2` is supported. | ||
|
|
||
| const assert = require('assert'); | ||
| const tls = require('tls'); | ||
|
|
||
| assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1'); | ||
|
|
||
| // Check the min-max version protocol versions against these CLI settings. | ||
| require('./test-tls-min-max-version.js'); |
| @@ -0,0 +1,15 @@ | ||
| // Flags: --tls-min-v1.0 --tls-min-v1.1 | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
| if (!common.hasCrypto) common.skip('missing crypto'); | ||
|
|
||
| // Check that `node --tls-v1.0` is supported, and overrides --tls-v1.1. | ||
|
|
||
| const assert = require('assert'); | ||
| const tls = require('tls'); | ||
|
|
||
| assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1'); | ||
|
|
||
| // Check the min-max version protocol versions against these CLI settings. | ||
| require('./test-tls-min-max-version.js'); |
| @@ -0,0 +1,15 @@ | ||
| // Flags: --tls-min-v1.1 | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
| if (!common.hasCrypto) common.skip('missing crypto'); | ||
|
|
||
| // Check that node `--tls-v1.1` is supported. | ||
|
|
||
| const assert = require('assert'); | ||
| const tls = require('tls'); | ||
|
|
||
| assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1.1'); | ||
|
|
||
| // Check the min-max version protocol versions against these CLI settings. | ||
| require('./test-tls-min-max-version.js'); |
| @@ -0,0 +1,15 @@ | ||
| // Flags: --tls-min-v1.2 | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
| if (!common.hasCrypto) common.skip('missing crypto'); | ||
|
|
||
| // Check that node `--tls-min-v1.2` is supported. | ||
|
|
||
| const assert = require('assert'); | ||
| const tls = require('tls'); | ||
|
|
||
| assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1.2'); | ||
|
|
||
| // Check the min-max version protocol versions against these CLI settings. | ||
| require('./test-tls-min-max-version.js'); |