Node "error:0308010C digital envelope routines unsupported" in CI - Fix OpenSSL 3
This OpenSSL 3 error appears when an older build tool uses a hashing algorithm (often MD4) that OpenSSL 3 disabled, crashing under newer Node.
What this error means
A build (commonly older webpack) crashes in CI with Error: error:0308010C:digital envelope routines::unsupported after the runner moved to a Node version bundling OpenSSL 3.
node
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:69:19)
at Object.createHash (node:crypto:138:10)
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines', code: 'ERR_OSSL_EVP_UNSUPPORTED'Common causes
A tool uses an algorithm OpenSSL 3 disabled
Older webpack and similar tools default to MD4 for hashing, which OpenSSL 3 no longer allows.
The CI Node version moved to OpenSSL 3
A newer Node bundles OpenSSL 3, exposing the incompatibility that did not appear on OpenSSL 1.1.
How to fix it
Upgrade the tool that uses the bad algorithm
- Upgrade webpack or the offending build tool to a version that uses an allowed hash.
- Re-run the build.
Terminal
npm install webpack@latestEnable the legacy provider as a stopgap
- Set NODE_OPTIONS to enable the OpenSSL legacy provider for the build step.
- Treat it as temporary while you upgrade the tool.
GitHub Actions
- run: npm run build
env:
NODE_OPTIONS: --openssl-legacy-providerHow to prevent it
- Upgrade build tooling to OpenSSL 3 compatible versions and pin the CI Node version so an OpenSSL bump does not silently break the build.
Related guides
Node DeprecationWarning Treated as Error in CI - Stop the Failing WarningFix CI jobs failing on a Node.js DeprecationWarning by replacing the deprecated API or removing the --throw-d…
Node "bad option" Unknown Flag in CI - Fix the Node InvocationFix the Node.js "bad option" unknown-flag error in CI by removing the flag, fixing its spelling, or using a N…
Node "The engine 'node' is incompatible" at Runtime in CI - Align Node VersionsFix the "engine node is incompatible" error in CI by pinning the CI Node version to satisfy the engines field…