windows - 无法在 Windows 上打开配置文件 :/usr/local/ssl/openssl. cnf

标签 windows openssl

<分区>

我已经安装了 OpenSSL 64。我想为我的 nodejs https 服务器使用证书。我运行了以下命令:

openssl genrsa -out subdomain.domain.com.key 1024

但是我得到了错误:

WARNING: can't open config file: /usr/local/ssl/openssl.cnf
Loading 'screen' into random state - done
Generating RSA private key, 1024 bit long modulus
.........++++++
.........................................++++++
unable to write 'random state'
e is 65537 (0x10001)

我该如何解决?
这是正确的命令吗?

最佳答案

解决方案是运行这个命令:

set OPENSSL_CONF=C:\OpenSSL-Win32\bin\openssl.cfg   

set OPENSSL_CONF=[path-to-OpenSSL-install-dir]\bin\openssl.cfg

在使用openssl 命令之前在命令提示符下。

openssl 确定在哪里可以找到它的 .cfg 文件。

或者,您可以在 Windows 环境变量中设置相同的变量 OPENSSL_CONF

注意:使用 OpenSSL binary distribution from Shining Light Productions 时可能会发生这种情况(官方 OpenSSL 的编译 + 安装程序版本,可免费下载和使用)。该发行版是从 OpenSSL 站点“半官方”链接的,作为“主要用于没有预编译 OpenSSL 包的操作系统的服务”。

关于windows - 无法在 Windows 上打开配置文件 :/usr/local/ssl/openssl. cnf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16658038/

相关文章:

c - 在 Windows 下访问 Gnu C 库

openssl - 静态编译 openssl 二进制文件

visual-studio-code - Visual Studio Code 无法识别已安装的 OpenSSL [ibp-vscode-extension]

openssl - make & make install OpenSSL 1.0.1e 一些错误

php - 在 Windows 上使用 iconv() 进行音译

windows - 在没有 Chocolatey 的情况下安装 Meteor.js

python - Windows XP GTK 应用程序 Glib 导入错误

安装窗口服务时Python已停止工作(3.7)

c - SSL BIO 和 FFI

php - 清理多余的 PHP 扩展 - 将所有内容切换到 mcrypt 或 openssl?