gpt4 book ai didi

openssl 创建证书和 key

转载 作者:行者123 更新时间:2023-12-04 18:58:17 25 4
gpt4 key购买 nike

[OpenSSL v1.1.0f]

我正在使用以下命令创建自签名证书,仅用于测试目的:

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

但是我收到这样的消息:
Can't open /usr/local/ssl/openssl.cnf for reading, No such file or directory
140480609138432:error:02001002:system library:fopen:No such file or directory:crypto/bio/bss_file.c:74:fopen('/usr/local/ssl/openssl.cnf','r')
140480609138432:error:2006D080:BIO routines:BIO_new_file:no such file:crypto/bio/bss_file.c:81:
Generating a 4096 bit RSA private key
..................................++
.................................................................................................................................................................................................................++
writing new private key to 'key.pem'
-----
unable to find 'distinguished_name' in config
problems making Certificate Request
140480609138432:error:0E06D06A:configuration file routines:NCONF_get_string:no conf or environment variable:crypto/conf/conf_lib.c:272:

我能做些什么来解决这个问题?

最佳答案

通常 openssl 会使用默认配置,但似乎您没有在正确的位置使用它。您还可以将配置文件作为命令行参数传递。请注意 -config 选项。

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

关于openssl 创建证书和 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46828554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com