简体   繁体   中英

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.

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. Is there a way to access the S3 storage not using SSL when on localhost? 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

This problem is also addressed in the aws-sdk-ruby repo

Ignoring certificate validation as Aniket suggested is a bad idea.

在初始化程序中创建一个文件并放置以下代码

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM