使用 openSSL 创建自签名 SSL 时出错

Error during creation self-signed SSL with openSSL

我想用自签名创建 restAPI SSL.I 安装 openSSL 并想用这个命令生成密钥

openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365

但我收到错误。

Can't open "C:\Program Files\OpenSSL-Win64\bin openssl.cfg" for reading, No such file or directory

202E0000:error:80000002:system library:BIO_new_file:No such file or directory:crypto\bio\bss_file.c:67:calling fopen(C:\Program Files\OpenSSL-Win64\bin openssl.cfg, r)

202E0000:error:10000080:BIO routines:BIO_new_file:no such file:crypto\bio\bss_file.c:75:

我试试

set OPENSSL_CONF=C:\Program Files\OpenSSL-Win64\bin openssl.cfg

但它没有解决我的问题

如果 openssl.cfg....\bin 中,则设置应为 set OPENSSL_CONF=C:\Program Files\OpenSSL-Win64\bin\openssl.cfg,即您设置中的最后一个 space 应改为 a\