OpenSSL和读取openssl.conf文件的错误 [英] OpenSSL and error in reading openssl.conf file
问题描述
我刚刚从以下URL下载了Openssl并安装了它。
http://www.slproweb.com/products/Win32OpenSSL.html
然后我尝试使用以下命令创建自签名证书
openssl req -x509 -days 365 -newkey rsa:1024 -keyout hostkey.pem -nodes -out hostcert.pem
然后它开始给出以下错误
无法从/ usr / local / ssl / openssl加载配置信息.cnf
然后在谷歌搜索之后,我将上述命令更改为
openssl req -config C:\OpenSSL\bin\openssl.conf -x509 -days 365 -newkey rsa:1024 -keyout hostkey.pem -nodes -out hostcert.pem
但现在我在命令提示符下收到以下错误
C:\OpenSSL\bin\openssl.conf上的-1行错误
4220:error:02001002:系统库:fopen:没有这样的文件或
目录:.\crypto\bio\bss_file.c:126:fopen('C:\OpenSSL\bin\openssl .conf','rb')
4220:error:2006D080:BIO例程:BIO_new_file:没有这样的
文件:.\crypto\bio\bss_file.c:129:
4220:error:0E078072:配置文件例程:DEF_LOAD:没有这样的
文件:.\crypto\conf\conf_def.c:197:
请帮忙。
提前感谢
在Windows上,您还可以设置环境属性 OPENSSL_CONF
。例如,从命令行可以输入:
set OPENSSL_CONF = c:/libs/openssl-0.9.8k/openssl.cnf
验证它可以键入:
echo%OPENSSL_CONF%
您还可以将其设置为的计算机的环境变量,所以所有用户和服务都默认可用。请参阅 Windows NT中的环境变量和如何在Windows XP中管理环境变量
现在,您可以运行openssl命令,而无需传递配置位置参数。 p>
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.
On Windows you can also set the environment property OPENSSL_CONF
. For example from the commandline you can type:
set OPENSSL_CONF=c:/libs/openssl-0.9.8k/openssl.cnf
to validate it you can type:
echo %OPENSSL_CONF%
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.
这篇关于OpenSSL和读取openssl.conf文件的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!