Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49e047f

Browse filesBrowse files
Trotttargos
authored andcommitted
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: #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>
1 parent 81d81a5 commit 49e047f
Copy full SHA for 49e047f

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-tls-basic-validations.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-basic-validations.js
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,15 @@ assert.throws(
118118
}
119119
);
120120
}
121+
122+
assert.throws(() => { tls.createSecureContext({ minVersion: 'fhqwhgads' }); },
123+
{
124+
code: 'ERR_TLS_INVALID_PROTOCOL_VERSION',
125+
name: 'TypeError'
126+
});
127+
128+
assert.throws(() => { tls.createSecureContext({ maxVersion: 'fhqwhgads' }); },
129+
{
130+
code: 'ERR_TLS_INVALID_PROTOCOL_VERSION',
131+
name: 'TypeError'
132+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.