GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — test: update tests for OpenSSL 3.0.14 by richardlau · Pull Request #53373 · nodejs/node Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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
fecfde6 to
25d62ec
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@richardlau Is there any chance you could make this conditional based on the version of OpenSSL? Otherwise, we'll likely forget about it and keep the old code here forever. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It's going to be complicated -- there's currently four OpenSSL 3 lines:
and the change is only in the latest release of each of those four lines. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
@tniessen We'd end up with code like this repeated for each of the three tests: diff --git a/test/parallel/test-http2-https-fallback.js b/test/parallel/test-http2-https-fallback.js index 8e0612375f4..8a1c06caad4 100644 --- a/test/parallel/test-http2-https-fallback.js +++ b/test/parallel/test-http2-https-fallback.js @@ -151,7 +151,14 @@ function onSession(session, next) { // Incompatible ALPN TLS client tls(Object.assign({ port, ALPNProtocols: ['fake'] }, clientOptions)) .on('error', common.mustCall((err) => { - strictEqual(err.code, 'ECONNRESET'); + // ECONNRESET prior to OpenSSL 3.0.14, 3.1.6, 3.2.2, and 3.3.1. + const { OPENSSL_VERSION_NUMBER } = require('node:crypto').constants; + const expectedErr = (OPENSSL_VERSION_NUMBER < 0x300000e0 || + (OPENSSL_VERSION_NUMBER >= 0x30100000 && OPENSSL_VERSION_NUMBER < 0x30100060) || + (OPENSSL_VERSION_NUMBER >= 0x30200000 && OPENSSL_VERSION_NUMBER < 0x30200020) || + (OPENSSL_VERSION_NUMBER >= 0x30300000 && OPENSSL_VERSION_NUMBER < 0x30300010)) ? + 'ECONNRESET' : 'ERR_SSL_TLSV1_ALERT_NO_APPLICATION_PROTOCOL'; + strictEqual(err.code, expectedErr); cleanup(); testNoALPN(); })); If you think this is worth doing I can update this PR, but I think this is harder to read. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@richardlau It's entirely up to you :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
In which case I'll land as-is as this has a passing CI, approvals and no blocks 🙂. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 14863e8 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
|
Older versions do fail the tests against newer OpenSSL versions, so could this be backported to v18 and v20? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Once it's gone out in a current (i.e. Node.js 22) release first. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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: nodejs#53373 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
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 <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
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 <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.