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.

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.

×
1 answer

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

Submit an Answer