【发布时间】:2018-08-11 15:48:33
【问题描述】:
我在与通配符证书斗争中度过了美好的一天......
现在,无法使用 .dev 进行本地开发,所以我们使用 *.test。我需要测试 HTTPS,所以我创建了通配符证书。
自 Chrome v58 起,“commonName”被忽略,用户应使用 SAN 来指定域名(更多关于此主题的信息:https://www.thesslstore.com/blog/security-changes-in-chrome-58/)。
无论如何:在我的系统(mac os / Docker / Chrome)上,通配符有问题 - 如果我在证书中指定整个域,它可以工作(比如 something.test) - 但是当我使用通配符时,Chrome 仍然会产生这个错误消息:NET::ERR_CERT_COMMON_NAME_INVALID
我几乎尝试了所有可能的方法,但没有运气:(
更多信息:
- http://grokify.github.io/security/wildcard-subject-alternative-name-ssl-tls-certificates/
- https://www.openssl.org/docs/man1.0.2/apps/x509v3_config.html#Subject-Alternative-Name
- https://medium.com/carwow-product-engineering/chrome-58-and-self-signed-ssl-certificate-c28a874d80fa
- https://github.com/webpack/webpack-dev-server/issues/854
我的 bash 脚本:
openssl req \
-x509 \
-nodes \
-new \
-newkey rsa:2048 \
-keyout test.key \
-out test.crt \
-sha256 \
-days 3650 \
-config <(cat <<EOF
[ req ]
prompt = no
distinguished_name = subject
x509_extensions = x509_ext
[ subject ]
commonName = *.test
[ x509_ext ]
subjectAltName = @alternate_names
[ alternate_names ]
DNS.1 = *.test
DNS.2 = test
EOF
)
【问题讨论】:
标签: google-chrome ssl ssl-certificate