创建自签名 SSL 证书时出错
我正在尝试使用 OpenSSL(Apache 2.2 + mod_ssl 附带的版本)创建自签名 SSL 证书。 OpenSSL 二进制文件位于 C:\Web\Apache2.2\bin 中,我使用的配置文件是 C:\Web\Apache2.2\conf\openssl.cnf
代码>.我已执行以下命令:(
我将使用换行符使其更具可读性。)
openssl req -config ..\conf\openssl.cnf -new -out ..\conf\eduardo.csr
-keyout ..\conf\eduardo.pem
# Then I entered country code, province, city, etc.
# This step worked correctly.
openssl rsa -in ..\conf\eduardo.pem -out ..\conf\eduardo.key
# Then I entered my pass phrase.
openssl x509 -in ..\conf\eduardo.csr -out ..\conf\eduardo.cert
-req -signkey ..\conf\eduardo.key -days 1000000
并且,在执行最后一步时,我得到以下输出:
Loading 'screen' into random state - done
Signature ok
subject=/C=PE/ST=Lima/L=Lima/...
Getting Private Key
unable to write 'random state' <--
我注意到文件 C:\Web\OpenSSL\bin \.rnd
是我执行第二个命令时生成的。我遇到的错误与该文件有任何关系吗?可能是什么问题?
PS:我已经尝试过使用Google,但只找到了适用于Linux的解决方案。
I am trying to create a self-signed SSL certificate using OpenSSL (the version that comes with Apache 2.2 + mod_ssl). The OpenSSL binaries are in C:\Web\Apache2.2\bin
, and the configuration file I am using is C:\Web\Apache2.2\conf\openssl.cnf
. I have executed the following commands:
(I will use newlines to make it more readable.)
openssl req -config ..\conf\openssl.cnf -new -out ..\conf\eduardo.csr
-keyout ..\conf\eduardo.pem
# Then I entered country code, province, city, etc.
# This step worked correctly.
openssl rsa -in ..\conf\eduardo.pem -out ..\conf\eduardo.key
# Then I entered my pass phrase.
openssl x509 -in ..\conf\eduardo.csr -out ..\conf\eduardo.cert
-req -signkey ..\conf\eduardo.key -days 1000000
And, when executing the last step, I got the following output:
Loading 'screen' into random state - done
Signature ok
subject=/C=PE/ST=Lima/L=Lima/...
Getting Private Key
unable to write 'random state' <--
I have noticed that the file C:\Web\OpenSSL\bin\.rnd
was generated when I executed the second command. Is the error I got in any way related to that file? What could be the problem?
PS: I have already tried using Google, and I have only found solutions that work in Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这个,我建议确保您具有读/写权限对于 C:\Web\OpenSSL\bin\.rnd,如果这不起作用,请将 $RANDFILE(或者,对于 Windows,%RANDFILE%)设置为您可以写入的文件。
Looking at this, I would suggest making sure you have read/write permissions for
C:\Web\OpenSSL\bin\.rnd
, and if that doesn't work, setting $RANDFILE (or, for windows, %RANDFILE%) to a file you can write to.