如何使OpenSSL在Windows Vista上写入RANDFILE? [英] How do I make OpenSSL write the RANDFILE on Windows Vista?
问题描述
当我跑步时:
openssl genrsa -out mykey.key 2048
我收到以下错误:
unable to write 'random state'
e is 65537 (0x10001)
我的Google搜索表明这是某种Vista权限问题.如何允许Vista写入此文件,或者如何配置openssl来解决这个问题?
My googling suggests this is some kind of Vista permissions issue. How can I allow Vista to write this file or how can I configure openssl to get round it?
推荐答案
根本问题是OpenSSL配置文件中的RANDFILE变量在Windows上被忽略.这是一个长期存在的问题,并一直持续到从OpenSSL v1.0a版本开始存在,而不论目标Windows平台是x86还是x64.
The root issue is that the RANDFILE variable in the OpenSSL configuration file is ignored on Windows. This has been a long-standing problem that continues to exist as of the OpenSSL v1.0a release, regardless of whether the target Windows platform is x86 or x64.
不过,有一个非常简单的解决方案.只需使用常规环境变量来设置RANDFILE值,例如
There is a delightfully simple solution, though. Merely use a regular environmental var to set the RANDFILE value, like
set RANDFILE=.rnd
由于此值是临时值,因此必须为每个新的DOS框重新发出该值,或在批处理文件中编写该脚本.
Because this value is ephemeral, it must be re-issued for every new DOS box, or scripted in a batch file.
这篇关于如何使OpenSSL在Windows Vista上写入RANDFILE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!