By Dhwanit
Hello,
Our Ruby on Rails 5 based production app is configured to use Active Storage with the “amazon” engine, to access files on Digital Ocean Spaces.
Since the Digital Ocean Spaces API is compatible with AWS S3 API, using Active Storage with “amazon” engine, which uses the AWS Ruby SDK (https://github.com/aws/aws-sdk-ruby) behind the scenes, didn’t seem like a problem.
However, we have observed that Digital Ocean Spaces API calls are failing with the following error returned from the AWS Ruby SDK:
Seahorse::Client::NetworkingError (SSL_connect returned=1 errno=0 state=error: certificate verify failed (ok))
Searching for the issue online resulted in a few sources that pointed to one solution of using the bundled AWS certificates. This solution is based on the assumption that the host machine may not have the required certificate to connect to AWS S3.
However, this solution will not work for us because we are using Digital Ocean Spaces and not AWS S3. Does your development team have suggestions on how to tackle this issue? Maybe Ruby experts who have run into this problem can suggest a fix.
Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
It’s been a while, but I just ran into the same problem and the following solution worked: https://meta.discourse.org/t/uploads-migrate-to-s3-fails-with-seahorse-certificate-verify-failed-on-digital-ocean-spaces/141158
In short, the user interface of Digitalocean provides the spaces endpoint with the bucket name as subdomain like “https://<bucketname>.ams3.digitaloceanspaces.com” while the aws-sdk-s3 gem expects only the server path “https://ams3.digitaloceanspaces.com”
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.