$ docker run -e "NODE_OPTIONS=--openssl-legacy-provider" --entrypoint="" public.ecr.aws/lambda/nodejs:18 node -e "require('crypto').Hash('md4')"
gives following error
Unable to load legacy provider.
node:internal/crypto/hash:69
this[kHandle] = new _Hash(algorithm, xofLen);
^
Error: error:12800067:DSO support routines::could not load the shared library
at new Hash (node:internal/crypto/hash:69:19)
at Object.Hash (node:internal/crypto/hash:62:12)
at [eval]:1:19
at Script.runInThisContext (node:vm:123:12)
at Object.runInThisContext (node:vm:299:38)
at node:internal/process/execution:79:19
at [eval]-wrapper:6:22
at evalScript (node:internal/process/execution:78:60)
at node:internal/main/eval_string:28:3 {
opensslErrorStack: [
'error:03000086:digital envelope routines::initialization error',
'error:0308010C:digital envelope routines::unsupported',
'error:07880025:common libcrypto routines::reason(524325)',
'error:12800067:DSO support routines::could not load the shared library'
],
library: 'DSO support routines',
reason: 'could not load the shared library',
code: 'ERR_OSSL_DSO_COULD_NOT_LOAD_THE_SHARED_LIBRARY'
}
Node.js v18.17.1
Actually, I have the same error using webpack
It's Node.js problem but this would be quite essential in node.js@18 and hard to understand what is the reason.
gives following error
Actually, I have the same error using webpack
It's Node.js problem but this would be quite essential in node.js@18 and hard to understand what is the reason.
found this discussion https://github.com/openssl/openssl/discussions/21417
and
/var/lang/lib/ossl-modules/legacy.so
was found in this imagebut
still has problem
Found workaround.
OPENSSL_MODULES=/var/lang/lib/ossl-modules
inspired by https://github.com/openssl/openssl/issues/13115#issuecomment-707481332