Skip to content

crypto: fix setEngine() when OPENSSL_NO_ENGINE set

When OpenSSL is configured with OPENSSL_NO_ENGINE, setEngine() currently throws an internal error because the C++ binding does not export the relevant function, which causes _setEngine() to be undefined within JS.

Instead, match the behavior of tls/secure-context.js and throw the existing error code ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED when OpenSSL has been configured with OPENSSL_NO_ENGINE.

For reference:

https://github.com/nodejs/node/blob/7984af69a090dd6d1f60ffe7e194d5e69bce0c20/lib/internal/tls/secure-context.js#L202-L205

https://github.com/nodejs/node/blob/7984af69a090dd6d1f60ffe7e194d5e69bce0c20/lib/internal/tls/secure-context.js#L285-L288

Merge request reports

Loading