GoogleSearchBox

Custom Search

Tuesday, June 18, 2013

:system library:fopen:No such file or directory:.\crypto\bio\bss_file.c:169:fopen('openssl.cnf','rb') .. BIO routines:BIO_new_file:no such file:.\crypto\bio\bss_file .. configuration file routines:DEF_LOAD:no such file:.\crypto\conf\conf_

Basically I was trying to use openssl for windows   to create my ssl certificates on Windox Xp machine:

While firing the command :

C:\certs\windowsOpenSSLCerts\tomcat6-CAS-certs>openssl req -config openssl.cnf -new -x509 -days 3650 -key tomcat6CAS-rootCAkey.key -out tomcat6CAS-rootCAcert.crt

I got below Error:

error on line -1 of openssl.cnf
2588:error:02001002:system library:fopen:No such file or directory:.\crypto\bio\bss_file.c:169:fopen('openssl.cnf','rb')

2588:error:2006D080:BIO routines:BIO_new_file:no such file:.\crypto\bio\bss_file.c:172:
2588:error:0E078072:configuration file routines:DEF_LOAD:no such file:.\crypto\conf\conf_def.c:197:

As shown in picture below:



Problems could be below:
1. check the "openssl.cfg" file location and pass that file location:
for example: pass like this to keytool:   -config  C:\OpenSSL-Win32\bin\openssl.cfg
Where "openssl.cfg" should exist at location "C:\OpenSSL-Win32\bin\"  or provide the location according to your requirement where you have kept the "openssl.cfg".

2. Check the name of the "openssl.cfg" file.
Keep in mind.  In Linux environment its named as "openssl.cnf"
Where as for Windows its named as "openssl.cfg"
So, Check for the file extension.

In my case, if you notice carefully, I had the 2nd problem.
So changing the
 -config openssl.cnf          to     -config openssl.cfg
Solved my issue.