diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2021-10-16 09:50:16 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2021-10-18 16:43:16 +0300 |
commit | 1d2f37d970e839ab2acafd871fe369babdb1a334 (patch) | |
tree | 7d49be861a8fce986b4f6ac910f56ee8949fe37f /src/node_options.cc | |
parent | d434c5382ae1fb7031c644141512a006016a9cbb (diff) |
src: add --openssl-legacy-provider option
This commit adds an option to Node.js named --openssl-legacy-provider
and if specified will load OpenSSL 3.0 Legacy provider.
$ ./node --help
...
--openssl-legacy-provider enable OpenSSL 3.0 legacy provider
Example usage:
$ ./node --openssl-legacy-provider -p 'crypto.createHash("md4")'
Hash {
_options: undefined,
[Symbol(kHandle)]: Hash {},
[Symbol(kState)]: { [Symbol(kFinalized)]: false }
}
Co-authored-by: Richard Lau <rlau@redhat.com>
Refs: https://github.com/nodejs/node/issues/40455
PR-URL: https://github.com/nodejs/node/pull/40478
Refs: https://github.com/nodejs/node/issues/40455
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/node_options.cc')
-rw-r--r-- | src/node_options.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/node_options.cc b/src/node_options.cc index 00bdc6688a4..3363860919a 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -4,6 +4,9 @@ #include "env-inl.h" #include "node_binding.h" #include "node_internals.h" +#if HAVE_OPENSSL +#include "openssl/opensslv.h" +#endif #include <errno.h> #include <sstream> @@ -814,6 +817,13 @@ PerProcessOptionsParser::PerProcessOptionsParser( &PerProcessOptions::secure_heap_min, kAllowedInEnvironment); #endif +#if OPENSSL_VERSION_MAJOR >= 3 + AddOption("--openssl-legacy-provider", + "enable OpenSSL 3.0 legacy provider", + &PerProcessOptions::openssl_legacy_provider, + kAllowedInEnvironment); + +#endif // OPENSSL_VERSION_MAJOR AddOption("--use-largepages", "Map the Node.js static code to large pages. Options are " "'off' (the default value, meaning do not map), " |