问题描述
我从 https:/下载了ca-bundle.crt/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问题...使用Homebrew安装openssl w 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!