【发布时间】:2011-09-14 12:25:20
【问题描述】:
在需要 ssl 认证检查的远程位置(如 github)使用模板创建新的 Rails 应用程序时,我遇到了一些问题。我正在使用带有 ruby1.9.2 和 openssl 的雪豹,两者都安装了 macports。
rails new rails_mongo -m https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-mongoid-devise-template.rb
将导致:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
为了避免这个问题,我使用 SSL_CERT_FILE 变量运行 rails:
SSL_CERT_FILE=/opt/local/share/curl/curl-ca-bundle.crt rails new rails_mongo -m https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-mongoid-devise-template.rb
为了保持这个设置,我在我的 .bash_profile 中设置了 SSL_CERT_FILE 变量,并且 echo 确认该变量具有正确的值:
echo $SSL_CERT_FILE
/opt/local/share/curl/curl-ca-bundle.crt
但是,如果我再次运行 rails,证书检查将失败,我不明白为什么? 有没有其他方法可以在不到处设置 OpenSSL::SSL::VERIFY_NONE 的情况下避免这个问题?
(像 git 这样的其他应用程序一直运行良好)
谢谢
【问题讨论】:
标签: ruby-on-rails macos github openssl