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 d173604

Browse filesBrowse files
panvaaduh95
authored andcommitted
test: use an always invalid cipher and cover OpenSSL 4.0 behaviours
Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #62805 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 72f5216 commit d173604
Copy full SHA for d173604

1 file changed

+18-1Lines changed: 18 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-tls-set-ciphers-error.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-set-ciphers-error.js
+18-1Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ if (!common.hasCrypto)
77
const assert = require('assert');
88
const tls = require('tls');
99
const fixtures = require('../common/fixtures');
10+
const { hasOpenSSL } = require('../common/crypto');
1011

1112
{
1213
const options = {
1314
key: fixtures.readKey('agent2-key.pem'),
1415
cert: fixtures.readKey('agent2-cert.pem'),
15-
ciphers: 'aes256-sha'
16+
ciphers: 'DES-CBC-SHA'
1617
};
1718
assert.throws(() => tls.createServer(options, common.mustNotCall()),
1819
/no[_ ]cipher[_ ]match/i);
@@ -23,3 +24,19 @@ const fixtures = require('../common/fixtures');
2324
assert.throws(() => tls.createServer(options, common.mustNotCall()),
2425
/no[_ ]cipher[_ ]match/i);
2526
}
27+
28+
// Cipher name matching is case-sensitive prior to OpenSSL 4.0, and
29+
// case-insensitive starting with OpenSSL 4.0.
30+
{
31+
const options = {
32+
key: fixtures.readKey('agent2-key.pem'),
33+
cert: fixtures.readKey('agent2-cert.pem'),
34+
ciphers: 'aes256-sha',
35+
};
36+
if (hasOpenSSL(4, 0)) {
37+
tls.createServer(options).close();
38+
} else {
39+
assert.throws(() => tls.createServer(options, common.mustNotCall()),
40+
/no[_ ]cipher[_ ]match/i);
41+
}
42+
}

0 commit comments

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