Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17.0.1 win10 x64 OpenSSL configuration error #40547

Closed
mortifia opened this issue Oct 21, 2021 · 26 comments
Closed

17.0.1 win10 x64 OpenSSL configuration error #40547

mortifia opened this issue Oct 21, 2021 · 26 comments
Labels
openssl Issues and PRs related to the OpenSSL dependency.

Comments

@mortifia
Copy link

Version

17.0.1

Platform

Microsoft Windows NT 10.0.19043.0 x64

Subsystem

No response

What steps will reproduce the bug?

npm
bug

How often does it reproduce? Is there a required condition?

just install

What is the expected behavior?

to work

What do you see instead?

No response

Additional information

powershell and vscode

Windows PowerShell
Copyright (C) Microsoft Corporation. Tous droits réservés.

Testez le nouveau système multiplateforme PowerShell https://aka.ms/pscore6

Impossible de charger le module PSReadline. La console s'exécute sans PSReadline.
PS C:\Users\amela> npm
OpenSSL configuration error:
8C810000:error:80000002:system library:BIO_new_file:No such file or directory:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:67:calling fopen(C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf, rb)
8C810000:error:10000080:BIO routines:BIO_new_file:no such file:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:75:
8C810000:error:07000072:configuration file routines:def_load:no such file:c:\ws\deps\openssl\openssl\crypto\conf\conf_def.c:179:
OpenSSL configuration error:
80440000:error:80000002:system library:BIO_new_file:No such file or directory:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:67:calling fopen(C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf, rb)
80440000:error:10000080:BIO routines:BIO_new_file:no such file:c:\ws\deps\openssl\openssl\crypto\bio\bss_file.c:75:
80440000:error:07000072:configuration file routines:def_load:no such file:c:\ws\deps\openssl\openssl\crypto\conf\conf_def.c:179:
PS C:\Users\amela>
@iam-frankqiu iam-frankqiu added the openssl Issues and PRs related to the OpenSSL dependency. label Oct 21, 2021
@iam-frankqiu
Copy link
Contributor

Thank you for your report. But could you provide more info about the steps that reproduce the bug?

@nassau-t
Copy link

nassau-t commented Oct 21, 2021

Same version, and for me it works ok, on Windows.

It seems there is a problem in your path. Or some configuration.

Can you execute this on powershell? cmd /c echo %PATH%
and also this? cmd /c echo %OPENSSL_CONF%

@mortifia
Copy link
Author

mortifia commented Oct 22, 2021

Windows PowerShell
Copyright (C) Microsoft Corporation. Tous droits réservés.

Testez le nouveau système multiplateforme PowerShell https://aka.ms/pscore6

PS C:\Users\amela> cmd /c echo %PATH%
C:\Python310\Scripts\;C:\Python310\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\src\flutter\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\PostgreSQL\13\bin;C:\Program Files (x86)\Incredibuild;C:\Users\amela\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\PuTTY\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\kubectl\;C:\Program Files (x86)\stripe;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\Program Files\nodejs\;C:\Users\amela\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\amela\AppData\Local\Programs\Python\Python39\;C:\Users\amela\AppData\Local\Microsoft\WindowsApps;C:\Users\amela\AppData\Local\Programs\Microsoft VS Code\bin;C:\tools\dart-sdk\bin;C:\Users\amela\AppData\Roaming\Pub\Cache\bin;C:\Users\amela\AppData\Local\Pub\Cache\bin;C:\Users\amela\.dotnet\tools;C:\Users\amela\AppData\Roaming\npm
PS C:\Users\amela>
PS C:\Users\amela>
PS C:\Users\amela>
PS C:\Users\amela> cmd /c echo %OPENSSL_CONF%
C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf
PS C:\Users\amela>

ps: with lts all work fine

@nassau-t
Copy link

nassau-t commented Oct 22, 2021

node v16.x uses openssl v1.1.1, node v17.x uses openssl v3,
So, perphaps openssl v3 can't work with a openssl 1.x config file.

In a powershell, try to execute: $env:OPENSSL_CONF = ''
So, OPENSSL_CONF var will be empty (in that same powershell).
Then, execute: npm
It works?

@mortifia
Copy link
Author

it works but it was mainly to prevent that the installer has a problem / forgetfulness

@nassau-t
Copy link

Ok. So I think node v17 is ok.
The problem is with your environment that has an explicit OPENSSL_CONF. I have Postgres 11 in my machine but OPENSSL_CONF isn't defined. But perhaps there is another program that uses odbc and openssl to connect to Postgres. So, you can undefine that environment variable and look if all other programs work ok, or configure then specific program not using whole system OPENSSL_CONF.

@mortifia
Copy link
Author

mortifia commented Oct 23, 2021

what I'm trying to say is that node v17 should not be affected by the configuration of another program (https://www.npmjs.com/package/postgres, or dbeaver)

this is I find a serious problem because either it works, or it does not work and if it does not work when we have just installed it is that there is a problem (unless there is a configuration to do that is explicitly described)

the "it's work on my computer" must not exist only the "it's work" must have to exist with an installer

@nassau-t
Copy link

All other programs will be affected if you have a OPENSSL_CONF global variable. Because node loads opensslv3 and openssl3 try to load his config from OPENSSL_CONF. So it is a problem of opensslv3, not really a problem of node.js.
In fact, the problem is not with the installer, the problem is later, when you try to run npm.
One solution is to undefine that global variable OPENSSL_CONF. Have you tried to undefine that global variable? All works fine?

Note that I don't belong to node.js, I only express on my own.

@nassau-t
Copy link

In fact, I have postgres 14, and have tried to install psqlodbc 13 from https://www.postgresql.org/ftp/odbc/versions/msi/
and it doesn't install any openssl.cnf, not have created any OPENSSL_CONF.

@AdamMajer
Copy link
Contributor

Your software is going to be affected by the variables in its environment. OPENSSL_CONF is OpenSSL env variable. All software that uses OpenSSL will use this. So, if you want only your Postgres instance to have it defined, only define it for your Postgres instance and not other software.

This is not a bug. It's a user misconfiguration.

@mortifia
Copy link
Author

mortifia commented Oct 25, 2021

I thought that this problem came from the installer because it is the only one that created this problem for me and for your information I had not created any openssl conf

but I think I know what the problem is and yes it does not come at all from here (this thing will have me bored until the end)
the uninstallation is incomplete and its installation poorly done ...

Sorry for the inconvenience !

@nassau-t
Copy link

nassau-t commented Oct 25, 2021

Perhaps you don't created the OPENSSL_CONF, but some program have done it. It's not an impossible thing to do what people say to you. But you have to swim against the river. The world is not against you, you are against the rest of the world.

@Er4twXz
Copy link

Er4twXz commented Nov 15, 2021

I installed postgreSQL14 -- It sets OPENSSL_CONF to C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf

so I get the same error with nodejs as mentioned in the topic of this issue

set OPENSSL_CONF= before using node fixes it

I guess the question is whether its helpful that both programs use the same environment variable

@umurpza
Copy link

umurpza commented Nov 19, 2021

I ran into the same problem. If NPM doesn't need the variable to be set anyway, why is it completely breaking npm? This is not a case of misconfiguration, I also think it should be fixed or worked around by the NPM/Node team.

@nassau-t
Copy link

The workaround is as Er4twXz said,
set OPENSSL_CONF= before using node (or npm) fixes it

@AdamMajer
Copy link
Contributor

I installed postgreSQL14 -- It sets OPENSSL_CONF to C:\Program Files\PostgreSQL\psqlODBC\etc\openssl.cnf

Please report this as an error to whoever builds the PostgreSQL 14 package. This is an error that they leak this config parameter to the system. It should only be set to whatever postgres applications require it and nothing else.

It's not a Node issue that postgres installer breaks your system. Not pointing fingers or anything 😺

@umurpza
Copy link

umurpza commented Nov 21, 2021

I'll try. You're probably right about it being in the wrong place. However, I'm still curious why a system variable that doesn't seem to affect Node would completely break it.

@AdamMajer
Copy link
Contributor

I'll try. You're probably right about it being in the wrong place. However, I'm still curious why a system variable that doesn't seem to affect Node would completely break it.

It affects ALL software that use OpenSSL. Both Node and PostgreSQL link with OpenSSL. If you install something else that uses OpenSSL, it will get affected by this system variable setting as well

@nassau-t
Copy link

nassau-t commented Nov 29, 2021

In Windows, If I set
set OPENSSL_CONF="C:\Program Files\Git\usr\ssl\openssl.cnf" or set OPENSSL_CONF=""
then node 17.1.0 doesn't start.

But If I set
set OPENSSL_CONF=
It starts.

You must look how to do the same on Linux.
Try export OPENSSL_CONF='' or export OPENSSL_CONF= or unset OPENSSL_CONF
Perhaps the last option, the best.

Workaround

Create a mynode file on the PATH (type echo $PATH to see the PATH), and in that file this three lines:

#!/bin/sh
unset OPENSSL_CONF
node $*

Then you must do chmod +x mynode, to be able to run mynode.
Then simply execute mynode. (If this file is not in your PATH, you can execute it doing ./mynode if it's in the working directory)

So, this ./mynode -e "console.log('hello!')" should work.

And you can do the same with npm, creating a file mynpm.

I don't have a Linux to try, but this is the idea.

@lucasantonioc
Copy link

I also had the same problem but I do have postgres installed. Upon checking, I noticed that there was the OPENSSL_CONF environment variable. I just deleted it and it worked for me.

@zaidraed
Copy link

zaidraed commented Jun 9, 2022

Create a empty file named openssl.cnf in C:\Program Files\PostgreSQL\psqlODBC\etc\ this directory.

It resolve my problem after creating this empty configuration file in PostgreSQL ODBC.

@kirtimukha
Copy link

@zaidraed It works~!!! Thank you.
I was very frustrated cause any of above, didn't work.
Finally got a solution from you. Thank you!!

@bnoordhuis bnoordhuis mentioned this issue Jan 29, 2023
@alihdev
Copy link

alihdev commented Feb 7, 2024

@zaidraed It works~!!! Thank you. ++

@ePaltjon
Copy link

Same version, and for me it works ok, on Windows.

It seems there is a problem in your path. Or some configuration.

Can you execute this on powershell? cmd /c echo %PATH% and also this? cmd /c echo %OPENSSL_CONF%

I am getting a similar error as @mortifia had, but did not have a similar output to @nassau-t 's question. Similarly, the solutions that have been suggested did not work. Both npm and Node are installed. Do y'all have an idea on what I could try next? My output to @nassau-t 's question is below:

PS C:\Users\ethan> cmd /c echo %PATH%
C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\HP\HP One Agent;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\ethan\AppData\Local\Programs\Python\Launcher\;C:\Users\ethan\AppData\Local\Microsoft\WindowsApps;C:\msys64\ucrt64\bin;C:\Users\ethan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts;C:\Program Files\Azure Data Studio\bin;C:\Users\ethan\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\ethan\AppData\Local\Programs\Python\Python312\Scripts;C:\Users\ethan\AppData\Roaming\npm
PS C:\Users\ethan> cmd /c echo %OPENSSL_CONF%
%OPENSSL_CONF%

@nassau-t
Copy link

nassau-t commented Aug 21, 2024

Try to set OPENSSL_CONF to some directory, and create there an empty openssl.cnf file.
Or look for openssl.conf file and rename it to .bad (perhaps it is on C:\windows\System32\OpenSSH)

@ePaltjon
Copy link

Thank you for the suggestion! It didn't end up working, as the error turned out to be with the version of npm that I was using instead of the OPENSSL_CONF. For anyone that runs into a similar issue when trying to use create-react-app, follow the following steps to solve the error:

  1. run npm i -g npm@latest
  2. run npm uninstall -g create-react-app
  3. run npx [email protected] ds-web-app

Your web app should be built. If it isn't, check that 5.0.1 is the latest version of npm and check the following resources below:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openssl Issues and PRs related to the OpenSSL dependency.
Projects
None yet
Development

No branches or pull requests

12 participants