SSL 自签
自签
openssl genrsa -out ca.key 2048openssl req -sha256 -new -x509 -days 7300 -key ca.key -out ca.crt \ -subj "/C=CN/ST=Guangdong/L=Shenzhen/O=Zhxlp/OU=IT/CN=Zhxlp Root CA"openssl x509 -in ca.crt -text -nooutopenssl genrsa -out server.key 2048openssl req -new -sha256 -key server.key \ -subj "/C=CN/ST=Guangdong/L=Shenzhen/O=Zhxlp/OU=IT/CN=www.zhxlp.com" \ -reqexts SAN \ -config <(cat /etc/pki/tls/openssl.cnf \ <(printf "[SAN]\nsubjectAltName=DNS:www.zhxlp.com,DNS:zhxlp.com,DNS:localhost,IP:127.0.0.1")) \ -out server.csropenssl req -in server.csr -noout -textopenssl x509 -req -days 365 \ -CAserial server.srl -CAcreateserial \ -in server.csr -CA ca.crt -CAkey ca.key \ -extensions SAN \ -extfile <(cat /etc/pki/tls/openssl.cnf \ <(printf "[SAN]\nsubjectAltName=DNS:www.zhxlp.com,DNS:zhxlp.com,DNS:localhost,IP:127.0.0.1")) \ -out server.crtopenssl x509 -in server.crt -noout -text
最后更新于