错误码是NET::ERR_CERT_COMMON_NAME_INVALID
解决方法:
- 给IP签名
#!/bin/bash
IP="1.2.3.4"
keytool \
-genkey \
-alias "${IP}" \
-sigalg SHA512withRSA \
-keyalg RSA \
-keysize 4096 \
-validity 3650 \
-keystore "${IP}".jks \
-dname "C=CN,ST=上海,L=上海,O=公司,OU=单位,CN=${IP}" \
-ext SAN=IP:"${IP}" \
&&
keytool \
-certreq \
-alias "${IP}" \
-file "${IP}".csr \
-keystore "${IP}".jks \
&&
keytool \
-importkeystore \
-srckeystore "${IP}".jks \
-destkeystore "${IP}".p12 \
-srcstoretype jks \
-deststoretype pkcs12 \
&&
openssl pkcs12 -in "${IP}".p12 -nokeys -clcerts -out "${IP}".cert.pem \
&&
openssl pkcs12 -in "${IP}".p12 -nocerts -out "${IP}".key.pem
之后生成出来的证书和密钥即可使用
将证书添加至信任区即可
标签:...,keytool,Chrome,IP,pkcs12,jks,SSL,p12,&& From: https://www.cnblogs.com/spacelit/p/17121361.html