ruby was-sdk v2:Seahorse :: Client :: NetworkingError异常:SSL_connect

时间:2015-03-28 15:24:09

标签: ruby ssl ssl-certificate aws-sdk

我从https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt下载了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束

然而,执行:

 @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

 Aws.config[:ssl_ca_bundle] = '/usr/local/etc/openssl/certs/ca-bundle.crt'

我还尝试禁用ssl对等验证(仅用于测试目的)

 Aws.config[:ssl_verify_peer] = false

但在两项测试中,它仍然失败..

我阅读了有关此主题的一些问题,但没有一个与最终的v2版本相关......可能是什么是最终的'解决这个问题? 感谢您的反馈

1 个答案:

答案 0 :(得分:2)

这是OS X / Homebrew问题...... 安装openssl w Homebrew CA证书位于:/usr/local/etc/openssl/cert.pem

所以我需要配置它:

 Aws.config[:ssl_ca_bundle] = '/usr/local/etc/openssl/cert.pem'