本帖最后由 xixi3 于 2022-5-6 15:22 编辑
想折腾一个自签的HTTPS,IOS上安装了CA证书访问依然爆错,我感觉没有设置错误啊。
my-openssl.cnf文件如下
- [ ca ]
- default_ca = CA_default
- [ CA_default ]
- x509_extensions = usr_cert
- [ req ]
- default_bits = 2048
- default_md = sha256
- default_keyfile = privkey.pem
- distinguished_name = req_distinguished_name
- attributes = req_attributes
- x509_extensions = v3_ca
- string_mask = utf8only
- [ req_distinguished_name ]
- [ req_attributes ]
- [ usr_cert ]
- basicConstraints = CA:FALSE
- nsComment = "OpenSSL Generated Certificate"
- subjectKeyIdentifier = hash
- authorityKeyIdentifier = keyid,issuer
- [ v3_ca ]
- subjectKeyIdentifier = hash
- authorityKeyIdentifier = keyid:always,issuer
- basicConstraints = CA:true
复制代码
CA签名指令:
- openssl genrsa -out ca.key 2048
- openssl req -x509 -new -nodes -key ca.key -subj "/CN=example.ca.com" -days 5000 -out ca.crt
复制代码
证书签名指令:
- openssl genrsa -out ca.key 4096
-
- openssl req -x509 -new -nodes -key ca.key -subj "/CN=ca.qingmuhy.com" -days 36500 -out ca.crt
-
- openssl genrsa -out server.key 4096
-
-
- openssl req -new -sha512 -key server.key
- -subj "/CN=webdav.qingmuhy.com"
- -reqexts SAN
- -config <(cat my-openssl.cnf <(printf "n[SAN]nsubjectAltName=DNS:webdav.qingmuhy.com"))
- -out server.csr
-
- openssl x509 -req -days 36500
- -in ios.csr -CA ca.crt -CAkey ca.key -CAcreateserial
- -extfile <(printf "subjectAltName=DNS:webdav.qingmuhy.com")
- -out server.crt
复制代码
相关的文件放在附件里了,因为后面我还要再重新弄,所以发也没啥问题,请懂得MJJ能帮忙指点一下,看了好几个HTTPS原理视频了,总找不到问题所在。
最后不管你知不知道问题在哪,感谢你看到这里。 |