如何让 OpenSSL 在 Windows Vista 上写入 RANDFILE? [英] How do I make OpenSSL write the RANDFILE on Windows Vista?

查看:20
本文介绍了如何让 OpenSSL 在 Windows Vista 上写入 RANDFILE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我跑步时:

openssl genrsa -out mykey.key 2048

我收到以下错误:

unable to write 'random state'
    e is 65537 (0x10001)

我的谷歌搜索表明这是某种 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆