: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 终极解决办法!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 终极解决办法!相关的知识,希望对你有一定的参考价值。

参考技术A 1.修改host文件,有些人可以用这个解决,但我尝试了多次还是不行
2.重启电脑 也不行
最终自己尝试修改 git 代理地址 (前提是得有个 vpn )

后面的1080 端口是不一定的 自己查看自己代理的socks5端口

另外这里如果网络还是不稳定 建议两手机热点

最终安装好了 可以重置回去

SSL_connect (Errno::ECONNRESET)

【中文标题】SSL_connect (Errno::ECONNRESET)【英文标题】: 【发布时间】:2016-06-08 11:41:38 【问题描述】:

我们有基于黄瓜的 UI 自动化测试框架。最近我们从 Ruby 1.9.x 迁移到 2.2.0,之后我们在通过测试框架登录到我们的应用程序时遇到了问题。它说 SSL 连接重置问题。

错误跟踪:

07:01:26 An existing connection was forcibly closed by the remote host. - 
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:46:in `connect'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:46:in `ssl_connect'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:24:in `create_socket'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:739:in `block in connect'
07:01:26 D:/Ruby223/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
07:01:26 D:/Ruby223/lib/ruby/2.2.0/timeout.rb:98:in `call'
07:01:26 D:/Ruby223/lib/ruby/2.2.0/timeout.rb:98:in `timeout'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:735:in `connect'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:497:in `query'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:170:in `query'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1238:in `do_get_block'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1021:in `block in do_request'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1129:in `protect_keep_alive_disconnected'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:1016:in `do_request'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:858:in `request'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/httpclient-2.7.1/lib/httpclient.rb:761:in `post'
<-- our Code for login kick in to call httpclient --->
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/rb_support/rb_language.rb:96:in `load'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/rb_support/rb_language.rb:96:in `load_code_file'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:142:in `load_file'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:84:in `block in load_files!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:83:in `each'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime/support_code.rb:83:in `load_files!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime.rb:254:in `load_step_definitions'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/runtime.rb:62:in `run!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/lib/cucumber/cli/main.rb:32:in `execute!'
07:01:26 D:/Ruby223/lib/ruby/gems/2.2.0/gems/cucumber-2.3.2/bin/cucumber:8:in `<top (required)>'

【问题讨论】:

你解决了吗?有同样的问题......我有一个使用 Ruby 1.9.3 和 rest-client 的测试套件也有同样的问题。我们正在 IIS 上针对 C# webapp 运行。 【参考方案1】:

在迁移到 ruby​​ 2.0.0 后不久我遇到了同样的问题

按照以下步骤解决

1)访问urlhttp://curl.haxx.se/ca/cacert.pem 将内容保存为.pem文件(不要保存为文本文件。确保扩展名是.pem)

2)将文件复制到本地的任何路径,例如:C:\ruby200\ca_cert.pem(在我的情况下)

3) 现在添加一个带有变量 SSL_CERT_FILE 和值“C:\ruby200\ca_cert.pem”(不带引号)的环境变量(路径在我的情况下。替换为适当的路径) (可以通过导航到计算机 -> 高级设置 -> 环境变量来添加环境变量)

4)关闭所有命令提示符并重新启动它们。现在应该可以正常工作了

【讨论】:

【参考方案2】:

我认为您的 gem 已更新。在您的代码中添加这些行以解决问题

http.verify_mode = OpenSSL::SSL::VERIFY_NONE

http.use_ssl = true之前

我希望这可以解决问题。

【讨论】:

禁用 ssl 验证是一个非常糟糕的主意。你不应该在生产系统中使用它。 我可以在内部测试 webapp。几乎。我更喜欢使用证书验证对等方。

以上是关于: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 终极解决办法!的主要内容,如果未能解决你的问题,请参考以下文章

git 使用代理出现 LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 错误

: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 终极解决办法!

LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 问题+解决过程

超快速安装Mac上的Homebrow,解决homebrow安装错误curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to

安装libressl后升级ntp

MacOS下使用OpenSSL(LibreSSL)