Hello, this is Copilot! I’m the new AI-powered chat mode of Microsoft that can help you quickly get information about Write really short introduction. Provide an overview of the ‘opensslErrorStack error 03000086 digital envelope routines initialization error error’, explaining its occurrence and relevance in software development. .
The opensslErrorStack error 03000086
occurs due to issues with the initialization of digital envelope routines in OpenSSL. This error is often triggered under the following conditions:
Node.js Version: The error is commonly seen when using Node.js version 17 or later, which defaults to OpenSSL 3.0. This version has breaking changes compared to previous versions.
MD4 Algorithm: OpenSSL 3.0 does not enable the MD4 algorithm by default. Tools like Webpack, which use the MD4 algorithm for creating file hashes, will fail during the build process.
Legacy Algorithms: The error can also occur if legacy algorithms (like MD2, MD4, MDC2) are required but not enabled. This is often the case when older cryptographic methods are used in the code.
To resolve this error, you can:
--openssl-legacy-provider
flag in your build script to enable legacy algorithms.Here are the common causes of the opensslErrorStack error 03000086 digital envelope routines initialization error
:
Node.js Version:
OpenSSL Version:
Webpack Configuration:
Environment Variables:
NODE_OPTIONS
environment variable settings, such as not including --openssl-legacy-provider
.Cryptographic Key Issues:
Here’s a detailed, step-by-step guide to solve the opensslErrorStack error 03000086 digital envelope routines initialization error
:
This error typically occurs due to incompatibility between Node.js and OpenSSL versions. Node.js v17 and later use OpenSSL v3, which has breaking changes affecting certain cryptographic algorithms.
--openssl-legacy-provider
FlagYou can resolve this by using the --openssl-legacy-provider
flag. This flag enables legacy algorithms that are no longer enabled by default in OpenSSL v3.
export NODE_OPTIONS=--openssl-legacy-provider
set NODE_OPTIONS=--openssl-legacy-provider
$env:NODE_OPTIONS="--openssl-legacy-provider"
ENV NODE_OPTIONS="--openssl-legacy-provider"
package.json
If you are using a build tool like Create React App or Vue CLI, you can add the flag directly to your scripts in package.json
.
{
"scripts": {
"start": "react-scripts start --openssl-legacy-provider"
}
}
{
"scripts": {
"serve": "vue-cli-service serve --openssl-legacy-provider"
}
}
If you are using Webpack, ensure you are using version 5.61.0 or later, which includes a fix for this issue.
npm install webpack@latest
If you encounter an error stating that --openssl-legacy-provider
is not allowed in NODE_OPTIONS
, you may need to unset the environment variable and rerun your script.
unset NODE_OPTIONS
set NODE_OPTIONS=
[Environment]::SetEnvironmentVariable('NODE_OPTIONS', '', 'User')
[Environment]::SetEnvironmentVariable('NODE_OPTIONS', '', 'Machine')
After making these changes, restart your development server to apply the new settings.
This should resolve the opensslErrorStack error 03000086 digital envelope routines initialization error
.
To resolve the opensslErrorStack error 03000086 digital envelope routines initialization error
, you can try the following methods:
Use a Different Node.js Version:
Set Environment Variables:
--openssl-legacy-provider
flag to your build script in package.json
:"scripts": {
"start": "react-scripts start --openssl-legacy-provider"
}
NODE_OPTIONS
environment variable:
export NODE_OPTIONS=--openssl-legacy-provider
set NODE_OPTIONS=--openssl-legacy-provider
$env:NODE_OPTIONS="--openssl-legacy-provider"
Upgrade Webpack:
These methods should help you resolve the error and get your application running smoothly.
To prevent the opensslErrorStack error 03000086 digital envelope routines initialization error
in future projects, follow these tips:
--openssl-legacy-provider
flag to your build scripts. For example:"scripts": {
"start": "react-scripts start --openssl-legacy-provider"
}
NODE_OPTIONS
environment variable:export NODE_OPTIONS=--openssl-legacy-provider
export DEBUG=true
Implementing these practices should help you avoid this error in future projects.
When encountering the opensslErrorStack
error 03000086 digital envelope routines initialization error, consider the following solutions:
--openssl-legacy-provider
in your build script or NODE_OPTIONS
variable.It’s crucial to ensure compatibility between your Node.js version and OpenSSL, as Node.js 17 and above use OpenSSL 3 by default, which may cause issues.
Setting the NODE_OPTIONS
environment variable can help resolve the error. Running Node.js in debug mode can also provide more detailed error messages for debugging purposes.
Proper configuration is essential to avoid this error in future projects.