Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING: can't open config file: ./bin/openssl.cnf

makecert

and press enter then this error occurs.

I tried with solutions provided but that not worked for me.

ex: set OPENSSL_CONF=c:/OpenSSL_Win64/bin/openssl.cnf

<pre>WARNING: can't open config file: ./bin/openssl.cnf
Unable to load config info from ./bin/openssl.cnf
WARNING: can't open config file: ./bin/openssl.cnf
Error opening Private Key privkey.pem
5344:error:02001002:system library:fopen:No such file or directory:.\crypto\bio\
bss_file.c:398:fopen('privkey.pem','rb')
5344:error:20074002:BIO routines:FILE_CTRL:system lib:.\crypto\bio\bss_file.c:40
0:
unable to load Private Key
WARNING: can't open config file: ./bin/openssl.cnf
Loading 'screen' into random state - done
server.csr: No such file or directory
Could Not Find C:\xampp\apache\.rnd
Could Not Find C:\xampp\apache\privkey.pem
Could Not Find C:\xampp\apache\server.csr
The system cannot find the file specified.
The system cannot find the file specified.

-----
Das Zertifikat wurde erstellt.
The certificate was provided.</pre>
like image 363
Somnath Avatar asked Aug 04 '15 09:08

Somnath


1 Answers

Explaining your problem

This error occurs mainly on Windows computers when you are using OpenSSL package or the Windows installer!

The reason is that OpenSSL failed to locate the openssl.cnf file!


Step-by-Step instructions

I will recommend that you do the following (windows only):

  1. Open your command prompt as Administrator (few OpenSSL commands opens in random state), thus when OpenSSL tries to write stuff on your disk it fails.

    • Try this easy and fast method: Open the Run dialog box with Win+R key, type cmd and hit Enter
  2. Now before you run any OpenSSL command type the following:

    set OPENSSL_CONF=c:\[PATH TO YOUR OPENSSL DIRECTORY]\bin\openssl.cfg

    • A sample path is: C:\OpenSSL-Win32\bin\openssl.cfg. For Windows (x64-bit) use C:\OpenSSL-Win64\bin\openssl.cfg!

After you did this now you are good to go with your OpenSSL stuff. Try openssl version and the error is gone.

Remember that everytime you open a command prompt you have to run the above command unless you set this as your environment variable.


Solve your problem

Your problem could be:

  • You set the environment variable into the folder OpenSSL_Win64. It should be maybe in OpenSSL-Win64!
  • You forgot maybe to run the command prompt as a Administrator!
  • You set the environment variable to the file openssl.cnf but it must be openssl.cfg!

Helpful sites

Read also:

  • WARNING: can’t open config file: /usr/local/ssl/openssl.cnf on Windows 7 (another detailed instructions for your problem)
  • How To Add/Edit Environment Variables in Windows 7 (helpful if you want set the environment variables forever on your Windows!)
like image 101
Suriyaa Avatar answered Sep 21 '22 03:09

Suriyaa