| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7393e37 commit 109c097
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1351,7 +1351,7 @@ changes: | |||
| 1351 | 1351 | * `maxVersion` {string} Optionally set the maximum TLS version to allow. One | |
| 1352 | 1352 | of `TLSv1.3`, `TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified | |
| 1353 | 1353 | along with the `secureProtocol` option, use one or the other. | |
| 1354 | - **Default:** `'TLSv1.3'`, unless changed using CLI options. Using | ||
| 1354 | + **Default:** `'TLSv1.2'`, unless changed using CLI options. Using | ||
| 1355 | 1355 | `--tls-max-v1.2` sets the default to `'TLSv1.2`'. Using `--tls-max-v1.3` | |
| 1356 | 1356 | sets the default to `'TLSv1.3'`. If multiple of the options are provided, | |
| 1357 | 1357 | the highest maximum is used. | |
@@ -1360,7 +1360,7 @@ changes: | |||
| 1360 | 1360 | along with the `secureProtocol` option, use one or the other. It is not | |
| 1361 | 1361 | recommended to use less than TLSv1.2, but it may be required for | |
| 1362 | 1362 | interoperability. | |
| 1363 | - **Default:** `'TLSv1.2'`, unless changed using CLI options. Using | ||
| 1363 | + **Default:** `'TLSv1'`, unless changed using CLI options. Using | ||
| 1364 | 1364 | `--tls-min-v1.0` sets the default to `'TLSv1'`. Using `--tls-min-v1.1` sets | |
| 1365 | 1365 | the default to `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to | |
| 1366 | 1366 | `'TLSv1.3'`. If multiple of the options are provided, the lowest minimum is | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,8 +54,6 @@ exports.DEFAULT_CIPHERS = | |||
| 54 | 54 | ||
| 55 | 55 | exports.DEFAULT_ECDH_CURVE = 'auto'; | |
| 56 | 56 | ||
| 57 | - exports.DEFAULT_MAX_VERSION = 'TLSv1.3'; | ||
| 58 | - | ||
| 59 | 57 | if (getOptionValue('--tls-min-v1.0')) | |
| 60 | 58 | exports.DEFAULT_MIN_VERSION = 'TLSv1'; | |
| 61 | 59 | else if (getOptionValue('--tls-min-v1.1')) | |
@@ -70,7 +68,7 @@ if (getOptionValue('--tls-max-v1.3')) | |||
| 70 | 68 | else if (getOptionValue('--tls-max-v1.2')) | |
| 71 | 69 | exports.DEFAULT_MAX_VERSION = 'TLSv1.2'; | |
| 72 | 70 | else | |
| 73 | - exports.DEFAULT_MAX_VERSION = 'TLSv1.3'; // Will depend on node version. | ||
| 71 | + exports.DEFAULT_MAX_VERSION = 'TLSv1.2'; // Will depend on node version. | ||
| 74 | 72 | ||
| 75 | 73 | ||
| 76 | 74 | exports.getCiphers = internalUtil.cachedResult( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -341,15 +341,15 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 341 | 341 | &EnvironmentOptions::tls_min_v1_3, | |
| 342 | 342 | kAllowedInEnvironment); | |
| 343 | 343 | AddOption("--tls-max-v1.2", | |
| 344 | - "set default TLS maximum to TLSv1.2 (default: TLSv1.3)", | ||
| 344 | + "set default TLS maximum to TLSv1.2 (default: TLSv1.2)", | ||
| 345 | 345 | &EnvironmentOptions::tls_max_v1_2, | |
| 346 | 346 | kAllowedInEnvironment); | |
| 347 | 347 | // Current plan is: | |
| 348 | 348 | // - 11.x and below: TLS1.3 is opt-in with --tls-max-v1.3 | |
| 349 | 349 | // - 12.x: TLS1.3 is opt-out with --tls-max-v1.2 | |
| 350 | 350 | // In either case, support both options they are uniformly available. | |
| 351 | 351 | AddOption("--tls-max-v1.3", | |
| 352 | - "set default TLS maximum to TLSv1.3 (default: TLSv1.3)", | ||
| 352 | + "set default TLS maximum to TLSv1.3 (default: TLSv1.2)", | ||
| 353 | 353 | &EnvironmentOptions::tls_max_v1_3, | |
| 354 | 354 | kAllowedInEnvironment); | |
| 355 | 355 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ if (!common.hasCrypto) common.skip('missing crypto'); | |||
| 8 | 8 | const assert = require('assert'); | |
| 9 | 9 | const tls = require('tls'); | |
| 10 | 10 | ||
| 11 | - assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.3'); | ||
| 11 | + assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| 12 | 12 | assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1'); | |
| 13 | 13 | ||
| 14 | 14 | // Check the min-max version protocol versions against these CLI settings. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ if (!common.hasCrypto) common.skip('missing crypto'); | |||
| 8 | 8 | const assert = require('assert'); | |
| 9 | 9 | const tls = require('tls'); | |
| 10 | 10 | ||
| 11 | - assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.3'); | ||
| 11 | + assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| 12 | 12 | assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1.1'); | |
| 13 | 13 | ||
| 14 | 14 | // Check the min-max version protocol versions against these CLI settings. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ if (!common.hasCrypto) common.skip('missing crypto'); | |||
| 8 | 8 | const assert = require('assert'); | |
| 9 | 9 | const tls = require('tls'); | |
| 10 | 10 | ||
| 11 | - assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.3'); | ||
| 11 | + assert.strictEqual(tls.DEFAULT_MAX_VERSION, 'TLSv1.2'); | ||
| 12 | 12 | assert.strictEqual(tls.DEFAULT_MIN_VERSION, 'TLSv1.3'); | |
| 13 | 13 | ||
| 14 | 14 | // Check the min-max version protocol versions against these CLI settings. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,4 @@ | |||
| 1 | + // Flags: --tls-max-v1.3 | ||
| 1 | 2 | 'use strict'; | |
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,8 +68,13 @@ function test(cmin, cmax, cprot, smin, smax, sprot, proto, cerr, serr) { | |||
| 68 | 68 | ||
| 69 | 69 | const U = undefined; | |
| 70 | 70 | ||
| 71 | - // Default protocol is the max version. | ||
| 72 | - test(U, U, U, U, U, U, DEFAULT_MAX_VERSION); | ||
| 71 | + if (DEFAULT_MAX_VERSION === 'TLSv1.2' && DEFAULT_MIN_VERSION === 'TLSv1.3') { | ||
| 72 | + // No connections are possible by default. | ||
| 73 | + test(U, U, U, U, U, U, U, 'ERR_SSL_NO_PROTOCOLS_AVAILABLE', U); | ||
| 74 | + } else { | ||
| 75 | + // Default protocol is the max version. | ||
| 76 | + test(U, U, U, U, U, U, DEFAULT_MAX_VERSION); | ||
| 77 | + } | ||
| 73 | 78 | ||
| 74 | 79 | // Insecure or invalid protocols cannot be enabled. | |
| 75 | 80 | test(U, U, U, U, U, 'SSLv2_method', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,9 +6,13 @@ const fixtures = require('../common/fixtures'); | |||
| 6 | 6 | // Test cipher: option for TLS. | |
| 7 | 7 | ||
| 8 | 8 | const { | |
| 9 | - assert, connect, keys | ||
| 9 | + assert, connect, keys, tls | ||
| 10 | 10 | } = require(fixtures.path('tls-connect')); | |
| 11 | 11 | ||
| 12 | + const tls13 = !!require('constants').TLS1_3_VERSION; | ||
| 13 | + | ||
| 14 | + if (tls13) | ||
| 15 | + tls.DEFAULT_MAX_VERSION = 'TLSv1.3'; | ||
| 12 | 16 | ||
| 13 | 17 | function test(cciphers, sciphers, cipher, cerr, serr) { | |
| 14 | 18 | assert(cipher || cerr || serr, 'test missing any expectations'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments