summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2019-05-01 12:51:44 -0700
committerSam Roberts <vieuxtech@gmail.com>2019-05-03 16:12:14 -0700
commitcb848b4546eeca234ce59434bb8a6bc6a6da4fc4 (patch)
treee9a10d21995a67cb2661d330e2a6ae8531b985cd /test
parentd370d126c3a2ad302cd15ff8063631983d1b4610 (diff)
downloadandroid-node-v8-cb848b4546eeca234ce59434bb8a6bc6a6da4fc4.tar.gz
android-node-v8-cb848b4546eeca234ce59434bb8a6bc6a6da4fc4.tar.bz2
android-node-v8-cb848b4546eeca234ce59434bb8a6bc6a6da4fc4.zip
tls: disallow conflicting TLS protocol options
Do not allow the minimum protocol level to be set higher than the max protocol level. See: https://github.com/nodejs/node/pull/26951, 109c097797b PR-URL: https://github.com/nodejs/node/pull/27521 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-tls-cli-min-max-conflict.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/parallel/test-tls-cli-min-max-conflict.js b/test/parallel/test-tls-cli-min-max-conflict.js
new file mode 100644
index 0000000000..68aae4c635
--- /dev/null
+++ b/test/parallel/test-tls-cli-min-max-conflict.js
@@ -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));
+});