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: https://github.com/openssl/openssl/pull/24338
Addresses these failures (Node.js dynamically linked against OpenSSL 3.0.14 -- I first noticed these (and other failures) with OpenSSL 3.2.2):
not ok 1779 parallel/test-http2-https-fallback
---
duration_ms: 164.14700
severity: fail
exitcode: 1
stack: |-
node:assert:126
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL'
- 'ECONNRESET'
at TLSSocket.<anonymous> (/home/nodejs/node/test/parallel/test-http2-https-fallback.js:154:11)
at TLSSocket.<anonymous> (/home/nodejs/node/test/common/index.js:466:15)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL',
expected: 'ECONNRESET',
operator: 'strictEqual'
}
Node.js v23.0.0-pre
...
--
not ok 1873 parallel/test-http2-server-unknown-protocol
---
duration_ms: 132.88000
severity: fail
exitcode: 1
stack: |-
node:assert:126
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL'
- 'ECONNRESET'
at TLSSocket.<anonymous> (/home/nodejs/node/test/parallel/test-http2-server-unknown-protocol.js:45:12)
at TLSSocket.<anonymous> (/home/nodejs/node/test/common/index.js:466:15)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL',
expected: 'ECONNRESET',
operator: 'strictEqual'
}
Node.js v23.0.0-pre
...
--
not ok 3010 parallel/test-tls-alpn-server-client
---
duration_ms: 156.74900
severity: fail
exitcode: 1
stack: |-
node:assert:126
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL'
- 'ECONNRESET'
at TLSSocket.<anonymous> (/home/nodejs/node/test/parallel/test-tls-alpn-server-client.js:195:14)
at TLSSocket.<anonymous> (/home/nodejs/node/test/common/index.js:466:15)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:170:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL',
expected: 'ECONNRESET',
operator: 'strictEqual'
}
Node.js v23.0.0-pre
...
cc @nodejs/crypto