小编Ash*_*esh的帖子

无法使用自签名证书摆脱 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万
查看次数

标签 统计

http ×1

https ×1

openssl ×1

ssl ×1

ssl-certificate ×1