问题描述
我从 https:///raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt并将其安装在我的 OS X Yosemite (10.10 w Ruby 2.2.1) 本地计算机上的/usr/local/etc/openssl/certs/ca-bundle.crt,因为 was-sdk v2 不再附带 SSL CA捆绑
I downloaded the ca-bundle.crt from https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crtand installed it on my OS X Yosemite (10.10 w Ruby 2.2.1) local computer at /usr/local/etc/openssl/certs/ca-bundle.crt, as the was-sdk v2 is not anymore shipped with an SSL CA bundle
但是,执行:
@s3 = Aws::S3::Client.new(credentials: Aws.config[:credentials] )
puts @s3.list_buckets()
我收到一个错误
*** Seahorse::Client::NetworkingError Exception: SSL_connect
returned=1 errno=0 state=SSLv3 read server certificate
B: certificate verify failed
我尝试成功地将 ca-bundle.cert 路径添加到我的 Aws.config
I tried wo success to add the ca-bundle.cert path to my Aws.config
Aws.config[:ssl_ca_bundle] = '/usr/local/etc/openssl/certs/ca-bundle.crt'
我还尝试禁用 ssl 对等验证(仅用于测试目的)
I also tried to disable the ssl peer verification (for test purpose only)
Aws.config[:ssl_verify_peer] = false
但在这两个测试中它仍然失败..
But in both tests it's still failing ..
我阅读了一些关于这个主题的问题,但没有一个与最终的 v2 版本相关......这个问题的最终"解决方案可能是什么?感谢反馈
I read some issues posted about this topic, but none related to the final v2 version ... what could be the 'definitive' solution to this issue ?thanks for feedback
推荐答案
这是一个 OS X/Homebrew 问题...安装 openssl w Homebrew CA 证书位于:/usr/local/etc/openssl/cert.pem
It's an OS X / Homebrew issue ...install openssl w Homebrew the CA cert is located at : /usr/local/etc/openssl/cert.pem
所以我需要配置它:
Aws.config[:ssl_ca_bundle] = '/usr/local/etc/openssl/cert.pem'
这篇关于ruby was-sdk v2:Seahorse::Client::NetworkingError 异常:SSL_connect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!