summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-11-30 11:28:38 -0800
committerRich Trott <rtrott@gmail.com>2019-12-02 11:43:28 -0800
commitcc3f2b386c6ee34f5574c69c29647165a9bc3aef (patch)
tree45cdfbc32c35d2edf0acd5e9d6d65357e5d06271
parentf0a31e5eb9c8512ec1d2badc9c372e544a0922e4 (diff)
downloadandroid-node-v8-cc3f2b386c6ee34f5574c69c29647165a9bc3aef.tar.gz
android-node-v8-cc3f2b386c6ee34f5574c69c29647165a9bc3aef.tar.bz2
android-node-v8-cc3f2b386c6ee34f5574c69c29647165a9bc3aef.zip
test: add coverage for ERR_TLS_INVALID_PROTOCOL_VERSION
There is currently no test that confirms that an invalid TLS protocol results in ERR_TLS_INVALID_PROTOCOL_VERSION. Add tests to check this for the `minVersion` and `maxVersion` options in `createSecureContext()`. Refs: https://codecov.io/gh/nodejs/node/src/c14c476614e3134867ddb997bdfe5a41ba668175/lib/_tls_common.js#L56 Refs: https://coverage.nodejs.org/coverage-c14c476614e31348/lib/_tls_common.js.html#L56 PR-URL: https://github.com/nodejs/node/pull/30741 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--test/parallel/test-tls-basic-validations.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/parallel/test-tls-basic-validations.js b/test/parallel/test-tls-basic-validations.js
index c4e2833464..763b60fac5 100644
--- a/test/parallel/test-tls-basic-validations.js
+++ b/test/parallel/test-tls-basic-validations.js
@@ -118,3 +118,15 @@ assert.throws(
}
);
}
+
+assert.throws(() => { tls.createSecureContext({ minVersion: 'fhqwhgads' }); },
+ {
+ code: 'ERR_TLS_INVALID_PROTOCOL_VERSION',
+ name: 'TypeError'
+ });
+
+assert.throws(() => { tls.createSecureContext({ maxVersion: 'fhqwhgads' }); },
+ {
+ code: 'ERR_TLS_INVALID_PROTOCOL_VERSION',
+ name: 'TypeError'
+ });