From 4c81dd2c5e8f749b83e63483b62a1989dfc12504 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Wed, 15 Dec 2021 10:17:08 -0500 Subject: [PATCH] test: do not load absolute path crypto engines twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer versions of OpenSSL now throws an error if an engine is loaded twice by its absolute path (a second load by its id appears to be okay). PR-URL: https://github.com/nodejs/node/pull/41177 Refs: https://github.com/quictls/openssl/pull/69 Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html Reviewed-By: Danielle Adams Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina Reviewed-By: Tobias Nießen Reviewed-By: Derek Lewis --- test/parallel/test-crypto-engine.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-crypto-engine.js b/test/parallel/test-crypto-engine.js index 399745f0f6463e..ca2e4793683788 100644 --- a/test/parallel/test-crypto-engine.js +++ b/test/parallel/test-crypto-engine.js @@ -44,10 +44,13 @@ crypto.setEngine('dynamic', crypto.constants.ENGINE_METHOD_RSA); fs.accessSync(enginePath); crypto.setEngine(enginePath); - crypto.setEngine(enginePath); + // OpenSSL 3.0.1 and 1.1.1m now throw errors if an engine is loaded again + // with a duplicate absolute path. + // TODO(richardlau): figure out why this fails on macOS but not Linux. + // crypto.setEngine(enginePath); - crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA); - crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA); + // crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA); + // crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA); process.env.OPENSSL_ENGINES = execDir;