Skip to content

Commit 4e34f9a

Browse files
lpincatargos
authored andcommitted
test: relax version check with shared OpenSSL
Relax the OpenSSL version check when Node.js is built with the `--shared-openssl` option. Verify only that `process.versions.openssl` is truthy. Fixes: #43078 PR-URL: #50505 Reviewed-By: Richard Lau <[email protected]>
1 parent 41ca113 commit 4e34f9a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

test/parallel/test-process-versions.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@ assert.match(process.versions.modules, /^\d+$/);
7575
assert.match(process.versions.cjs_module_lexer, commonTemplate);
7676

7777
if (common.hasCrypto) {
78-
const versionRegex = common.hasOpenSSL3 ?
79-
// The following also matches a development version of OpenSSL 3.x which
80-
// can be in the format '3.0.0-alpha4-dev'. This can be handy when building
81-
// and linking against the main development branch of OpenSSL.
82-
/^\d+\.\d+\.\d+(?:[-+][a-z0-9]+)*$/ :
83-
/^\d+\.\d+\.\d+[a-z]?(\+quic)?(-fips)?$/;
84-
assert.match(process.versions.openssl, versionRegex);
78+
if (process.config.variables.node_shared_openssl) {
79+
assert.ok(process.versions.openssl);
80+
} else {
81+
const versionRegex = common.hasOpenSSL3 ?
82+
// The following also matches a development version of OpenSSL 3.x which
83+
// can be in the format '3.0.0-alpha4-dev'. This can be handy when
84+
// building and linking against the main development branch of OpenSSL.
85+
/^\d+\.\d+\.\d+(?:[-+][a-z0-9]+)*$/ :
86+
/^\d+\.\d+\.\d+[a-z]?(\+quic)?(-fips)?$/;
87+
assert.match(process.versions.openssl, versionRegex);
88+
}
8589
}
8690

8791
for (let i = 0; i < expected_keys.length; i++) {

0 commit comments

Comments
 (0)