mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-08 23:10:04 +08:00
新增单证书包含多域名或多ip情况下证书生成
@@ -56,4 +56,38 @@ base64内容
|
|||||||
base64内容
|
base64内容
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
```
|
```
|
||||||
如果不是-----BEGIN RSA PRIVATE KEY----- 可以重新开始第4部,将文件调换下顺序,重新合并
|
如果不是-----BEGIN RSA PRIVATE KEY----- 可以重新开始第4部,将文件调换下顺序,重新合并
|
||||||
|
|
||||||
|
# 7、证书包含多ip或域名情况
|
||||||
|
## 创建服务器证书配置文件 server.conf
|
||||||
|
```
|
||||||
|
[ req ]
|
||||||
|
distinguished_name = req_distinguished_name
|
||||||
|
req_extensions = req_ext
|
||||||
|
|
||||||
|
[ req_distinguished_name ]
|
||||||
|
countryName = Country Name (2 letter code)
|
||||||
|
stateOrProvinceName = State or Province Name (full name)
|
||||||
|
localityName = Locality Name (eg, city)
|
||||||
|
organizationName = Organization Name (eg, company)
|
||||||
|
organizationalUnitName = Organizational Unit Name (eg, section)
|
||||||
|
commonName = Common Name (eg, fully qualified host name)
|
||||||
|
emailAddress = Email Address
|
||||||
|
|
||||||
|
[ req_ext ]
|
||||||
|
subjectAltName = @alt_names
|
||||||
|
|
||||||
|
[ alt_names ]
|
||||||
|
DNS.1 = localhost
|
||||||
|
DNS.2 = *.local
|
||||||
|
DNS.3 = wss.local
|
||||||
|
IP.1 = 192.168.1.10
|
||||||
|
IP.2 = 192.168.1.11
|
||||||
|
```
|
||||||
|
## 命令顺序
|
||||||
|
```bash
|
||||||
|
openssl genpkey -algorithm RSA -out server.key
|
||||||
|
openssl req -new -key server.key -out server.csr -config server.cnf
|
||||||
|
openssl x509 -req -in server.csr -signkey server.key -out server.crt -extensions req_ext -extfile openssl.cnf -days 36500
|
||||||
|
cat server.key server.crt > ./ssl.pem
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user