[英]Ruby rails paperclip Seahorse::Client::NetworkingError (SSL_connect returned=1 errno=0 state=error: certificate verify failed)
I am using ruby on rails, the paperclip 5
gem, I use it to upload images to Amazon S3 storage.我在 rails 上使用 ruby,即
paperclip 5
gem,我用它来将图像上传到 Amazon S3 存储。
When submitting, on my actual host machine, everything works perfect, uploads successfully, but if I upload on localhost, I get the following error:提交时,在我的实际主机上,一切正常,上传成功,但如果我在本地主机上上传,则会出现以下错误:
Completed 500 Internal Server Error in 3395ms (ActiveRecord: 2.5ms)
Seahorse::Client::NetworkingError (SSL_connect returned=1 errno=0 state=error: certificate verify failed):
I assume it's because I don't have SSL on localhost.我认为这是因为我在本地主机上没有 SSL。 Is there a way to access the S3 storage not using SSL when on localhost?
有没有办法在本地主机上访问不使用 SSL 的 S3 存储? Is there such a setting?
有这样的设定吗?
The solution to your problem is to load the certs.您的问题的解决方案是加载证书。 If your version of SSL doesn't have them, you can use the packaged certs, as documented here: QuickStart Guide to Using the AWS SDK for Ruby
如果您的 SSL 版本没有它们,您可以使用打包的证书,如此处所述: 使用适用于 Ruby 的 AWS 开发工具包的快速入门指南
This problem is also addressed in the aws-sdk-ruby repo这个问题也在aws-sdk-ruby 存储库中得到解决
Ignoring certificate validation as Aniket suggested is a bad idea.像 Aniket 建议的那样忽略证书验证是一个坏主意。
在初始化程序中创建一个文件并放置以下代码
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.