我尝试使用openssl生成https证书,但遇到错误。

huangapple go评论56阅读模式
英文:

I am trying to generate a https certificate from openssl but getting error

问题

无法打开 C:/OpenSSL/SSL/openssl.cnf 以进行读取,没有这个文件或目录
1332:error:02001003:system library:fopen:No such process:crypto/bio/bss_file.c:69:fopen('C:/OpenSSL/SSL/openssl.cnf','r')

英文:

When i am trying to generate an https certificate for my express app using below command i am getting error

openssl req -new -key privateKey.pem -out request.pem

Can't open C:/OpenSSL/SSL/openssl.cnf for reading, No such file or directory
1332:error:02001003:system library:fopen:No such process:crypto/bio/bss_file.c:69:fopen('C:/OpenSSL/SSL/openssl.cnf','r')

答案1

得分: 1

首先,我已经为openssl.conf设置了环境变量:

set OPENSSL_CONF=c:/program%20files/openssl/openssl.cnf // 或者是openssl.conf的位置

然后运行以下命令:

openssl req -new -key privateKey.pem -out request.pem

// 请记住,我已经使用命令 openssl genrsa -out privateKey.pem 1024 生成了私钥

它会要求回答一些问题,然后在文件夹位置生成证书。

英文:

First i had set the environment varaiable for openssl.conf

set OPENSSL_CONF=c:/program%20files/openssl/openssl.cnf // or what erver the location for openssl.conf

Then run gain the command,

openssl req -new -key privateKey.pem -out request.pem

// keep in mind i already generated the
// private key using command openssl genrsa -out privateKey.pem 1024

It asks for a couple of quesitions and then generate the certificate at the folder location.

huangapple
  • 本文由 发表于 2023年3月8日 17:08:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75671147.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定