OpenSSL在PKCS12导出期间因“将屏幕加载到随机状态"而挂起. [英] OpenSSL hangs during PKCS12 export with "Loading 'screen' into random state"
问题描述
我正在使用OpenSSL(不是makecert)生成一个自签名SSL证书,供在IIS中使用.
I am generating a self-signed SSL certificate with OpenSSL (not makecert), for use in IIS.
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes -subj '//CN=myhost'
(双斜杠是正确的.没有该命令,以上命令将不起作用.)
(The double slash is correct. The command above does not work without that.)
openssl pkcs12 -export -out key.pfx -inkey key.pem -in cert.pem -name 'myhost'
第一个命令运行成功完成.但是第二个卡住了
The first command runs completes successfully. However the second get stuck with
将屏幕"加载到随机状态-
Loading 'screen' into random state -
我正在使用Windows的Git(2.6.3)随附的OpenSSL(1.0.2d). 任何人都遇到相同的问题吗?
I am using OpenSSL (1.0.2d) that comes with Git for Windows (2.6.3). Anyone experiences the same issue?
说明:问题如何解决无法写入'随机状态'"在openssl 中描述了不同的问题-编写.rnd文件.这里的问题似乎是生成随机状态. (并且仅在第二个命令中.)
Clarification: Question How to fix "unable to write 'random state' " in openssl describes different -- problem with writing the the .rnd file. Here the problem seems to be generating the random state. (And only in the second command.)
推荐答案
请尝试添加 winpty
在oppenssl之前:
Please try to add winpty
before oppenssl:
winpty openssl ...
或者您可以运行由winpty包装的新bash:
or you can run a new bash wrapped by winpty:
winpty bash
在Windows控制台中,终端输入/输出存在一些问题,因此,如果某些软件要求unix
终端行为,则winpty可以提供帮助.
In the windows console, there is some problem with terminal input/output so winpty can help if some software requires unix
terminal behavior.
winpty
帮助我在这种环境下运行openssl:
winpty
helped me to run openssl in this environment:
git version 2.7.3.windows.1
OpenSSL 1.0.2g 1 Mar 2016
这篇关于OpenSSL在PKCS12导出期间因“将屏幕加载到随机状态"而挂起.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!