Allow non-standard openssl binary names Index: node-v22.14.0/test/common/crypto.js =================================================================== --- node-v22.14.0.orig/test/common/crypto.js +++ node-v22.14.0/test/common/crypto.js @@ -141,23 +141,29 @@ module.exports = { get opensslCli() { if (opensslCli !== null) return opensslCli; + let cli_candidates = []; if (process.config.variables.node_shared_openssl) { // Use external command - opensslCli = 'openssl'; + cli_candidates = cli_candidates.concat(['openssl-1_1', 'openssl']); } else { const path = require('path'); // Use command built from sources included in Node.js repository - opensslCli = path.join(path.dirname(process.execPath), 'openssl-cli'); + cli_candidates.push(path.join(path.dirname(process.execPath), 'openssl-cli')); } - if (exports.isWindows) opensslCli += '.exe'; - + let checkOpensslCli = function(opensslCli) { + if (exports.isWindows) opensslCli += '.exe'; + const opensslCmd = spawnSync(opensslCli, ['version']); + if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) { + // OpenSSL command cannot be executed + opensslCli = false; + } + return opensslCli; + }; const { spawnSync } = require('child_process'); - const opensslCmd = spawnSync(opensslCli, ['version']); - if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) { - // OpenSSL command cannot be executed - opensslCli = false; + for (let i=0; i