使用puma-dev获取本地的SSL / https for Rails

问题描述 投票:3回答:2

当你访问puma-dev时,puma-dev -install应该使用https / SSL,只需要初始安装https://yourlocalsitename.dev

我可以在Chrome> Dev Tools> Security中看到证书,但它说

This page is not secure (broken HTTPS).

Certificate Error
There are issues with the site's certificate chain (net::ERR_CERT_AUTHORITY_INVALID).

我怎样才能让puma-dev在本地https工作?

ruby-on-rails keychain puma
2个回答
7
投票

如果正常的puma-dev -install即使在brew卸载/安装puma-dev之后也不起作用试试这个recommended here

  1. 在Chrome>开发者工具>安全性中,单击查看证书
  2. 将证书图标拖到OS X桌面
  3. 在桌面上,双击证书将其安装在OS X> Keychain Access as System(不登录)中
  4. 从Keychain Access中,双击cert(在System中)并将下拉列表更改为Always Trust

现在再次尝试访问https://yourlocalsitename.dev,但在新标签中,它应该是绿色的https。


0
投票

在最近的MacOS / X版本中,证书的拖放功能对Chrome不起作用:

  • openssl s_client -connect 127.0.0.1:443 -servername your.site.localhost -showcerts。显示证书数据时中断。
  • 创建一个文件,其内容是从--- BEGIN CERTIFICATE行到--- END CERTIFICATE行(包括它们)的上一个命令的输出。
  • sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain <certificate file>
  • 打开Keychain Access应用程序,在系统钥匙串中找到证书,并将信任级别设置为“始终信任”
© www.soinside.com 2019 - 2024. All rights reserved.