Skip to content

Commit 2c84c3e

Browse files
committed
test: do not load absolute path crypto engines twice
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: nodejs#41175 Refs: quictls/openssl#68 Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Derek Lewis <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent f4493c1 commit 2c84c3e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/parallel/test-crypto-engine.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ crypto.setEngine('dynamic', crypto.constants.ENGINE_METHOD_RSA);
4444
fs.accessSync(enginePath);
4545

4646
crypto.setEngine(enginePath);
47-
crypto.setEngine(enginePath);
47+
// OpenSSL 3.0.1 and 1.1.1m now throw errors if an engine is loaded again
48+
// with a duplicate absolute path.
49+
// TODO(richardlau): figure out why this fails on macOS but not Linux.
50+
// crypto.setEngine(enginePath);
4851

49-
crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA);
50-
crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA);
52+
// crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA);
53+
// crypto.setEngine(enginePath, crypto.constants.ENGINE_METHOD_RSA);
5154

5255
process.env.OPENSSL_ENGINES = execDir;
5356

0 commit comments

Comments
 (0)