I am running windows xp 32bit
I just downloaded Openssl from the following URL and installed it. http://www.slproweb.com/products/Win32OpenSSL.html
and then i tried to create a self signed certificate by using the following command
openssl req -x509 -days 365 -newkey rsa:1024 -keyout hostkey.pem -nodes -out hostcert.pem
then it started giving the following error
Unable to load config info from /usr/local/ssl/openssl.cnf
Then after googling sometime i changed the above command to
openssl req -config C:\OpenSSL\bin\openssl.conf -x509 -days 365 -newkey rsa:1024 -keyout hostkey.pem -nodes -out hostcert.pem
But now i get the following error in the command prompt
error on line -1 of C:\OpenSSL\bin\openssl.conf
4220:error:02001002:system library:fopen:No such file or directory:.\crypto\bio\bss_file.c:126:fopen('C:\OpenSSL\bin\openssl.conf','rb') 4220:error:2006D080:BIO routines:BIO_new_file:no such file:.\crypto\bio\bss_file.c:129:
4220:error:0E078072:configuration file routines:DEF_LOAD:no such file:.\crypto\conf\conf_def.c:197:
Please help. Thanks in advance.
take care of the right extension (openssl.cfg not cnf)!
I have installed OpenSSL from here: http://slproweb.com/products/Win32OpenSSL.html
I just had a similar error using the openssl.exe from the Apache for windows bin folder. I had the -config flag specified by had a typo in the path of the openssl.cnf file. I think you'll find that
should be
Note: the conf should probably be cnf.
Just add to your command line the parameter
-config c:\your_openssl_path\openssl.cfg
, changingyour_openssl_path
to the real installed path.If you have installed Apache with OpenSSL navigate to bin directory. In my case D:\apache\bin.
*These commands also work if you have stand alone installation of openssl.
Run these commands:
*This will create self-signed certificate that you can use for development purposes
Again if you have Apache installed in the httpd.conf stick these:
On Windows you can also set the environment property
OPENSSL_CONF
. For example from the commandline you can type:to validate it you can type:
You can also set it as part of the computer's environmental variables so all users and services have it available by default. See, for example, Environment variables in Windows NT and How To Manage Environment Variables in Windows XP.
Now you can run openssl commands without having to pass the config location parameter.
This workaround helped us so much at my job (Tech Support), we made a simple batch file we could run from anywhere (We didnt have the permissions to install it). This workaround will set the variable and then run OpenSSL for you. It also opens up the bin folder for you (cause this is where any files you create or modify will be saved). Also, this is only for Windows.
How to Set Up:
Copy this code to a file named StartOpenSSL.bat. Save this to a location of your choice. It can be run from anywhere.