-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tls: disallow conflicting TLS protocol options
Do not allow the minimum protocol level to be set higher than the max protocol level. See: #26951, 109c097 PR-URL: #27521 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]>
- Loading branch information
1 parent
014a9fd
commit 7bbf951
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
if (!common.hasCrypto) common.skip('missing crypto'); | ||
|
||
// Check that conflicting TLS protocol versions are not allowed | ||
|
||
const assert = require('assert'); | ||
const child_process = require('child_process'); | ||
|
||
const args = ['--tls-min-v1.3', '--tls-max-v1.2', '-p', 'process.version']; | ||
child_process.execFile(process.argv[0], args, (err) => { | ||
assert(err); | ||
assert(/not both/.test(err.message)); | ||
}); |