SSL Certificate validation issue when using AWS SDK Ruby library to access Digital Ocean Spaces


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 ( 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.

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It’s been a while, but I just ran into the same problem and the following solution worked:

In short, the user interface of Digitalocean provides the spaces endpoint with the bucket name as subdomain like “https://<bucketname>” while the aws-sdk-s3 gem expects only the server path “