Skip to content

Commit 9f521f4

Browse files
committed
test: update tests for OpenSSL 3.0.14
Starting from OpenSSL 3.0.14, 3.1.6, 3.2.2, and 3.3.1, OpenSSL was fixed to return an error reason string for bad/unknown application protocols. Update tests to handle both the old `ECONNRESET` error on older versions of OpenSSL and the new `ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL` on newer versions of OpenSSL. Refs: openssl/openssl#24338 PR-URL: #53373 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 0092358 commit 9f521f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/parallel/test-tls-alpn-server-client.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ function TestALPNCallback() {
195195

196196
// Callback picks 2nd preference => undefined => ALPN rejected:
197197
assert.strictEqual(results[1].server, undefined);
198-
assert.strictEqual(results[1].client.error.code, 'ECONNRESET');
198+
const allowedErrors = ['ECONNRESET', 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL'];
199+
assert.ok(allowedErrors.includes(results[1].client.error.code), `'${results[1].client.error.code}' was not one of ${allowedErrors}.`);
199200

200201
TestBadALPNCallback();
201202
});
@@ -218,7 +219,8 @@ function TestBadALPNCallback() {
218219
runTest(clientsOptions, serverOptions, function(results) {
219220
// Callback returns 'http/5' => doesn't match client ALPN => error & reset
220221
assert.strictEqual(results[0].server, undefined);
221-
assert.strictEqual(results[0].client.error.code, 'ECONNRESET');
222+
const allowedErrors = ['ECONNRESET', 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL'];
223+
assert.ok(allowedErrors.includes(results[0].client.error.code), `'${results[0].client.error.code}' was not one of ${allowedErrors}.`);
222224

223225
TestALPNOptionsCallback();
224226
});

0 commit comments

Comments
 (0)