相关疑难解决方法(0)

使用可在 Chrome 58 中运行的 openssl 生成自签名证书

从 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.crtserver.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)

ssl openssl ssl-certificate chrome

70
推荐指数
5
解决办法
11万
查看次数

无法使用自签名证书摆脱 chrome 中的 `net::ERR_CERT_COMMON_NAME_INVALID` 错误

网络上有许多问题,人们在设置用于内部网络的自签名证书时遇到困难。

只是链接一些:
让 Chrome 接受自签名的本地主机证书
Chrome 接受自签名的本地主机
证书使用在 Chrome 58 StartCom 证书中工作的 openssl 生成自签名证书
错误:ERR_CERT_AUTHORITY_INVALID

我已经经历了他们中的每一个人,但仍然无法摆脱(net::ERR_CERT_COMMON_NAME_INVALID).错误。

步骤如下:

  • 服务器上的密钥和证书生成

    openssl req \          
    -newkey rsa:2048 \
    -x509 \
    -nodes \
    -keyout file.key \
    -new \
    -out file.crt \
    -subj /CN=Hostname \
    -reqexts SAN \
    -extensions SAN \
    -config <(cat /etc/ssl/openssl.cnf \
        <(printf '[SAN]\nsubjectAltName=DNS:192.168.0.1')) \
    -sha256 \
    -days 3650
    
    Run Code Online (Sandbox Code Playgroud)
  • 设置服务器进程 (apache) 以使用新生成的证书和密钥文件进行安全连接

  • 通过Chrome 开发工具导航到https://192.168.0.1:3122并使用导出选项,将证书文件从服务器导出到客户端
  • 使用
    • certutil
    • sudo cp file.crt /etc/pki/ca-trust/source/anchors; sudo upate-ca-trust
  • 重新启动铬

我还为 …

ssl http https openssl ssl-certificate

38
推荐指数
1
解决办法
9万
查看次数

标签 统计

openssl ×2

ssl ×2

ssl-certificate ×2

chrome ×1

http ×1

https ×1