ATTENTION: cannot open the configuration file: ./ bin / openssl.cnf

Makecert

and press enter, then this error will occur.

I tried with the provided solutions, but this did not work 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> 
+6
source share
3 answers

Explaining your problem

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

The reason is that OpenSSL could not find the openssl.cnf file !


Step by step instructions

I recommend you do the following (Windows only):

  1. Open a command prompt with administrator privileges (several OpenSSL commands open in an arbitrary state), so when OpenSSL tries to write something to disk, it crashes.

    • Try this quick and easy way: open the Run dialog with Win + R key type cmd and press Enter
  2. Now before running any OpenSSL command, type the following:

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

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

Once you have done this now, you can start working with OpenSSL. Try openssl version and the error will disappear.

Remember that every time you open a command line, you must run the above command, unless you set it as an environment variable.


Solve your problem

Your problem may be:

  • You set the environment variable to the OpenSSL_Win64 folder. This should be possible in OpenSSL-Win64 !
  • You may have forgotten to run the command line as administrator !
  • You set the environment variable to the openssl.cnf file but it must be openssl.cfg !

Useful sites

Read also:

+5
source

In manual mode, creating the openssl.cnf file in the right place can solve the problem.

Here is the file template (edit if necessary):

 # # OpenSSL configuration file. # # Establish working directory. dir = . [ ca ] default_ca = CA_default [ CA_default ] serial = $dir/serial database = $dir/certindex.txt new_certs_dir = $dir/certs certificate = $dir/cacert.pem private_key = $dir/private/cakey.pem default_days = 365 default_md = md5 preserve = no email_in_dn = no nameopt = default_ca certopt = default_ca policy = policy_match [ policy_match ] countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional [ req ] default_bits = 1024 # Size of keys default_keyfile = key.pem # name of generated keys default_md = md5 # message digest algorithm string_mask = nombstr # permitted characters distinguished_name = req_distinguished_name req_extensions = v3_req [ req_distinguished_name ] # Variable name Prompt string #------------------------- ---------------------------------- 0.organizationName = Organization Name (company) organizationalUnitName = Organizational Unit Name (department, division) emailAddress = Email Address emailAddress_max = 40 localityName = Locality Name (city, district) stateOrProvinceName = State or Province Name (full name) countryName = Country Name (2 letter code) countryName_min = 2 countryName_max = 2 commonName = Common Name (hostname, IP, or your name) commonName_max = 64 # Default values for the above, for consistency and less typing. # Variable name Value #------------------------ ------------------------------ 0.organizationName_default = My Company localityName_default = My Town stateOrProvinceName_default = State or Providence countryName_default = US [ v3_ca ] basicConstraints = CA:TRUE subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer:always [ v3_req ] basicConstraints = CA:FALSE subjectKeyIdentifier = hash 
+2
source

When installing, the application / OpenSSL_Win64 is located in C: \ Program Files \ OpenSSL-Win64, so you need to install this path using the cmd toolkit OPENSSL_CONF = C: \ Program Files \ OpenSSL-Win64 \ bin \ openssl.cfg

0
source

All Articles