Skip to content

Commit 6010ef4

Browse files
committed
fixup! test: update tests to run with OpenSSL >= 3.0 FIPS mode
1 parent 0ac2dee commit 6010ef4

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

test/parallel/test-tls-dhe.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ function test(dhparam, keylen, expectedCipher, expectedError) {
8585
};
8686

8787
const server = tls.createServer(options, (conn) => conn.end());
88-
if (typeof expectedError === 'string') {
88+
if (typeof expectedError === 'string' || Array.isArray(expectedError)) {
8989
server.once('tlsClientError', common.mustCall((err) => {
90-
assert.strictEqual(err.code, expectedError);
90+
if (Array.isArray(expectedError)) {
91+
assert.ok(expectedError.includes(err.code), err);
92+
} else {
93+
assert.strictEqual(err.code, expectedError);
94+
}
9195
}));
9296
}
9397

@@ -160,7 +164,10 @@ function testCustomParam(keylen, expectedCipher, expectedError) {
160164
await testCustomParam(2048, dheCipher);
161165
} else {
162166
const errorCode = hasFIPS(3, 5) ?
163-
'ERR_SSL_INVALID_KEY_LENGTH' : 'ERR_SSL_INTERNAL_ERROR';
167+
[
168+
'ERR_SSL_INVALID_KEY_LENGTH',
169+
'ERR_SSL_SSL/TLS_ALERT_ILLEGAL_PARAMETER',
170+
] : 'ERR_SSL_INTERNAL_ERROR';
164171
await testCustomParam(3072, null, errorCode);
165172
await testCustomParam(2048, null, errorCode);
166173
}

0 commit comments

Comments
 (0)