OpenSSL 和读取 openssl.conf 文件时出错 [英] OpenSSL and error in reading openssl.conf file
问题描述
我正在运行 windows xp 32 位
I am running windows xp 32bit
我刚刚从以下 URL 下载了 Openssl 并安装了它.http://www.slproweb.com/products/Win32OpenSSL.html
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
无法从/usr/local/ssl/openssl.cnf 加载配置信息
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:OpenSSLinopenssl.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
C:OpenSSLinopenssl.conf 的第 -1 行出错
4220:错误:02001002:系统库:fopen:没有那个文件或目录:.cryptoioss_file.c:126:fopen('C:OpenSSLinopenssl.conf','rb')4220:错误:2006D080:BIO 例程:BIO_new_file:没有这样的文件:.cryptoioss_file.c:129:
4220:错误:0E078072:配置文件例程:DEF_LOAD:没有这样的文件:.cryptoconfconf_def.c:197:
error on line -1 of C:OpenSSLinopenssl.conf
4220:error:02001002:system library:fopen:No such file or directory:.cryptoioss_file.c:126:fopen('C:OpenSSLinopenssl.conf','rb') 4220:error:2006D080:BIO routines:BIO_new_file:no such file:.cryptoioss_file.c:129:
4220:error:0E078072:configuration file routines:DEF_LOAD:no such file:.cryptoconfconf_def.c:197:
请帮忙.提前致谢.
推荐答案
在 Windows 上,您还可以设置环境属性 OPENSSL_CONF
.例如,您可以从命令行输入:
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%
您还可以将其设置为计算机环境变量的一部分,以便默认情况下所有用户和服务都可以使用它.例如,请参见 Windows NT 中的环境变量 和 如何在 Windows XP 中管理环境变量.
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.
现在您可以运行 openssl 命令而无需传递配置位置参数.
Now you can run openssl commands without having to pass the config location parameter.
这篇关于OpenSSL 和读取 openssl.conf 文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!