我正在尝试使用OpenSSL(Apache 2.2 + mod_ssl附带的版本)创建自签名SSL证书。 OpenSSL二进制文件位于C:\Web\Apache2.2\bin
,我使用的配置文件是C:\Web\Apache2.2\conf\openssl.cnf
。我已经执行以下命令:创建自签名SSL证书时出错
(我将使用换行符,使之更具可读性)
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中使用的解决方案。
可能的重复[如何让OpenSSL在Windows Vista上编写RANDFILE?](http://stackoverflow.com/questions/2229723/how-do-i-make-openssl-write-the-randfile-on -windows-vista) – jww 2014-08-13 13:01:07