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: c14c476614/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>
This commit is contained in:
parent
f0a31e5eb9
commit
cc3f2b386c
@ -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'
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user