简体   繁体   English

Ruby / Github:适用于OpenSSL :: SSL :: SSLError的常规解决方案?

[英]Ruby/Github: Appropriate general solution for OpenSSL::SSL::SSLError?

Every now and then I'm encountering problems with scripts hosted on Github which have been linked using https . 我时不时地遇到Github上托管的脚本的问题,这些脚本已使用https链接。 I've usually managed to get around it one way or the other, but I'm wondering what's the proper way of solving this? 我通常设法以一种或另一种方式解决它,但是我想知道解决这个问题的正确方法是什么?

Here's an example: I'd like to make use of this Rails Application template . 这是一个例子:我想利用这个Rails Application模板

Running 跑步

rails new APP_NAME -m https://raw.github.com/RailsApps/rails3-application-templates/master/rails3-devise-rspec-cucumber-template.rb -T

will throw: 会抛出:

certificate verify failed (OpenSSL::SSL::SSLError)

What is the proper way of going about this situation without editing the script itself? 在不编辑脚本本身的情况下解决这种情况的正确方法是什么?


UPDATE 更新

I've tried so far as well 到目前为止我也尝试过

export GIT_SSL_NO_VERIFY=true

but I keep on getting the same error. 但我不断遇到同样的错误。

I also exported the certificate from Firefox as github.com.pem and simply dragged it into my unlocked Keychain Access. 我还从Firefox将证书导出为github.com.pem,并将其拖动到我的未锁定钥匙串访问中。 The certificate is now listed but the error remains the same. 现在列出了证书,但错误仍然相同。


UPDATE 2 更新2

As awful this solution is, this hack works: http://blog.dominicsayers.com/2011/08/16/howto-use-a-rails-template-from-github-on-windows/ 糟糕的是,此解决方案有效: http : //blog.dominicsayers.com/2011/08/16/howto-use-a-rails-template-from-github-on-windows/

It seems that simply "updating" the certificates is the best option: 似乎简单地“更新”证书是最佳选择:

$ cd /usr/share/curl/
$ sudo wget http://curl.haxx.se/ca/cacert.pem
$ sudo mv curl-ca-bundle.crt old.curl-ca-bundle.crt
$ sudo mv cacert.pem curl-ca-bundle.crt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM