Better late than never.

生成Chrome可信任的https证书工具 - mkcert

GitHub地址

使用

  • 下载对应平台的mkcert

image

  • 使用
// 安装
mkcert -install

// 生成指定域名的证书(当前目录)
mkcert example.com example-staging.appspot.com localhost
  • Apache 配置 (nginx 替换对应证书即可)
<VirtualHost *:443>
   DocumentRoot "${ROOT}"
   ServerName ${SITE}
   ServerAlias *.${SITE}

   SSLEngine On
   SSLCertificateFile "C:\ssl\api.debug.ren.pem"
   SSLCertificateKeyFile "C:\ssl\api.debug.ren.pem"

   <Directory "${ROOT}">
       Options Indexes FollowSymLinks ExecCGI
       AllowOverride All
       Require all granted
   </Directory>

</VirtualHost>
  • 打开chrome查看证书已经变成可信任的了

image

-- END

写的不错,赞助一下主机费

扫一扫,用支付宝赞赏
扫一扫,用微信赞赏

暂无评论~~