如何解决“无法写入'随机状态'"在openssl中 [英] How to fix "unable to write 'random state' " in openssl
问题描述
使用此命令生成私钥时
genrsa -out my-prvkey.pem 1024
它引发如下错误
Loadind'screen'进入随机状态-完成生成RSA私有 密钥,1024位长模数 ......................................... +++++++ .................................... +++++++++无法写入'random state'e 是65537(0 * 10001)
Loadind 'screen' into random state -done Generating RSA private key,1024 bit long modulus .........................................+++++++ ...........................+++++++++ unable to write 'random state' e is 65537 (0*10001)
这在创建公共证书时会出现任何问题.我在Windows中运行此命令.谁能帮我解决这个问题?
This makes any problem while creating a public certificate. I'm running this command in windows. Can anyone help me for the fix?
推荐答案
最快的解决方案是:将环境变量 RANDFILE 设置为可以写入随机状态"文件的路径(当然,请检查文件访问权限),例如.在命令提示符下:
The quickest solution is: set environment variable RANDFILE to path where the 'random state' file can be written (of course check the file access permissions), eg. in your command prompt:
set RANDFILE=C:\MyDir\.rnd
openssl genrsa -out my-prvkey.pem 1024
更多说明: Windows上的OpenSSL尝试按以下顺序保存随机状态"文件:
More explanations: OpenSSL on Windows tries to save the 'random state' file in the following order:
- 从 RANDFILE 环境变量获取的路径
- 如果设置了 HOME 环境变量,则: $ {HOME} \.rnd
- C:\.rnd
- Path taken from RANDFILE environment variable
- If HOME environment variable is set then : ${HOME}\.rnd
- C:\.rnd
我很确定在您的情况下,它最终尝试将其保存在 C:\.rnd 中(并且由于缺少足够的访问权限而失败).不幸的是,OpenSSL不会打印任何错误消息中实际尝试使用的路径.
I'm pretty sure that in your case it ends up trying to save it in C:\.rnd (and it fails because lack of sufficient access rights). Unfortunately OpenSSL does not print the path that is actually tries to use in any error messages.
这篇关于如何解决“无法写入'随机状态'"在openssl中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!