gpt4 book ai didi

ssl - 生成自签名证书时配置文件 'v3.ext' 第 1 行出错

转载 作者:行者123 更新时间:2023-12-04 22:35:48 31 4
gpt4 key购买 nike

我正在尝试创建一个自签名的 SSL 证书,当我去生成 SSL 证书时,我收到了以下错误:

error on line 1 of config file 'v3.ext'

我用来生成证书的命令是:

openssl x509 -req -sha256 -extfile v3.ext -days 365 -in server.csr -signkey server.key -out server.crt

而我的v3.ext文件如下:

$ cat v3.ext
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
 
[alt_names]
DNS.1 = <common_name>
$

所以我想我的问题是我的 v3.ext 出了什么问题。我正在关注的指南在这里: https://ksearch.wordpress.com/2017/08/22/generate-and-import-a-self-signed-ssl-certificate-on-mac-osx-sierra/

最佳答案

我觉得你的 conf 文件很奇怪。我一直用于自签名或 pki 签名证书的格式如下:

[ req ]
default_bits = 4096
distinguished_name = req_distinguished_name
req_extensions = req_ext

[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = GB
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = England
localityName = Locality Name (eg, city)
localityName_default = Brighton
organizationName = Organization Name (eg, company)
organizationName_default = Hallmarkdesign
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_max = 64
commonName_default = localhost

[ req_ext ]
subjectAltName = @alt_names

[alt_names]
DNS.1 = your-website.dev
DNS.2 = another-website.dev

关于ssl - 生成自签名证书时配置文件 'v3.ext' 第 1 行出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59790962/

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