我真的很努力地使用自签名证书为通过Maven Jetty插件运行/配置的本地主机项目设置HTTPS ...我已经能够使其适用于野生动物园,但Google Chrome拒绝了即使它说我的证书有效
这是我从Chrome浏览器中收到的错误:NET::ERR_CERT_REVOKED
我从以下帖子中得到了自己的帮助:https://stackoverflow.com/a/60516812/11725563
我也使用macOS Catalina和Chrome 80+版本。另外,我将CN名称设置为localhost,并且每当它询问我所在的国家/地区城市时,我每次都会放置相同的内容。
这是我上面链接中发布的确切过程
######################
# Become a Certificate Authority
######################
# Generate private key
openssl genrsa -des3 -out myCA.key 2048
# Generate root certificate
openssl req -x509 -new -nodes -key myCA.key -sha256 -days 825 -out myCA.pem
# Create CA-signed certs
######################
# Generate private key
$[[ -e localhost.key ]] || openssl genrsa -out localhost.key 2048
# Create certificate-signing request
$[[ -e localhost.csr ]] || openssl req -new -key localhost.key -out localhost.csr
# Create a config file for the extensions
$>localhost.ext cat <<-EOF
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
extendedKeyUsage=serverAuth,clientAuth
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = $NAME
DNS.2 = bar.$NAME
EOF
$openssl x509 -req -in localhost.csr -CA myCA.pem -CAkey myCA.key \
-CAcreateserial -out localhost.crt -days 1825 -sha256 \
-extfile localhost.ext
然后我将myCA.pem添加到我的系统钥匙串中,然后转到详细信息并始终信任所有选项。
然后我运行以下命令来生成一个密钥库以放入我的码头文件夹中
$ openssl pkcs12 -inkey localhost.key -in localhost.crt -export \
-out localhost.pkcs12
$ keytool -importkeystore -srckeystore localhost.pkcs12 \
-srcstoretype PKCS12 -destkeystore keystore
然后我将密钥库文件移到我的Eclipse项目中的src / test / resources路径中。 但是正如我所说,在chrome中运行时会导致上述错误。我在做什么错