从 Chrome 58 开始,它不再接受依赖于Common Name
以下内容的自签名证书:https : //productforums.google.com/forum/#! topic/chrome/zVo3M8CgKzQ;context-place = topicsearchin/chrome/category $3ACanary%7Csort:相关性%7Cspell:false
相反,它需要使用Subject Alt Name
. 我之前一直在关注有关如何生成自签名证书的指南:https : //devcenter.heroku.com/articles/ssl-certificate-self,它工作得很好,因为我需要server.crt
和server.key
文件来完成我正在做的事情。我现在需要生成新的证书,其中包括SAN
我所有的尝试都没有在 Chrome 58 上工作。
这是我所做的:
我按照上面提到的 Heroku 文章中的步骤来生成密钥。然后我写了一个新的 OpenSSL 配置文件:
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = san
extensions = san
[ req_distinguished_name ]
countryName = US
stateOrProvinceName = Massachusetts
localityName = Boston
organizationName = MyCompany
[ san ]
subjectAltName = DNS:dev.mycompany.com
Run Code Online (Sandbox Code Playgroud)
然后server.crt
使用以下命令生成:
openssl req …
Run Code Online (Sandbox Code Playgroud)