我收到SSL_connect错误:
> ruby -ropen-uri -e 'eval open("https://git.io/vQhWq").read'
F:/Ruby/ruby/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)
from F:/Ruby/ruby/lib/ruby/2.3.0/net/http.rb:933:in `connect'
from F:/Ruby/ruby/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
from F:/Ruby/ruby/lib/ruby/2.3.0/net/http.rb:852:in `start'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:319:in `open_http'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:737:in `buffer_open'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:212:in `block in open_loop'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:210:in `catch'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:210:in `open_loop'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:717:in `open'
from F:/Ruby/ruby/lib/ruby/2.3.0/open-uri.rb:35:in `open'
from -e:1:in `<main>'
我尝试过的事情:
F:\Ruby\ruby\lib\ruby\site_ruby\2.3.0\rubygems\ssl_certs\index.rubygems.org\GlobalSignRootCA.pem
其他一些我不感兴趣的解决方案:
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http://rubygems.org
添加到gem sources
SSL_CERT_FILE
。但为什么?如本blog 设置SSL_CERT_FILE
如果您知道自己是什么,这不是一个不好的解决方案 在做。但是,有很多解决方案建议 将CA证书下载到您的计算机并设置 SSL_CERT_FILE环境变量到其位置。
此方法的问题是您不知道是否可以信任 您正在下载的CA证书。在某些情况下,CA证书 甚至以明文形式下载。如果你问我,那就麻烦了。
我在: