【发布时间】:2015-04-08 03:27:13
【问题描述】:
我正在运行 windows xp 32 位
我刚刚从以下 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:错误:02001002:系统库:fopen:没有这样的文件或 目录:.\crypto\bio\bss_file.c:126:fopen('C:\OpenSSL\bin\openssl.conf','rb') 4220:错误:2006D080:BIO 例程:BIO_new_file:没有这样的 文件:.\crypto\bio\bss_file.c:129:
4220:错误:0E078072:配置文件例程:DEF_LOAD:没有这样 文件:.\crypto\conf\conf_def.c:197:
请帮忙。 提前致谢。
【问题讨论】:
-
检查确切的文件名:openssl.conf ---> openssl.cnf
-
Windows 上的文件扩展名现在是 .cfg。还要确保指定的文件路径(在命令行或环境变量 OPENSSL_CONF 中)不在引号内。
-
文件扩展名 (.cnf/.cfg) 似乎因用于安装 OpenSSL 的内容而异。在 WampServer v3.2.2 安装上,我刚刚做了配置文件名是 openssl.cnf。我还使用 Shining Path Productions 的二进制文件安装了 Window10 64 位。该安装中的文件名为 openssl.cfg。 OpenSSL 配置文件扩展名的这种差异似乎与编译有关。我还没有测试 OpenSSL v1.1.1g 可以识别哪个扩展名。
-
您可能还想将 hostcert 文件扩展名更改为 .crt 或 .cer?
-
我们应该检查我们的安装,我安装了openssl lite,它没有这个配置文件。现在我正在使用 git 的 ssl,更多内容在这里 stackoverflow.com/questions/50625283/…
标签: windows configuration openssl environment-variables