Hello there!
I have updated the ssl package in my ubuntu vs, I signed the new certificates and installed them correctly using nginx, when I access my website it works perfectly, however… seems like ruby is not getting the new certificates because when in my rails app (running on unicorn) try to use the ssl package I got this error:
<pre>
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
</pre>
I got the same error when I try to run this code:
<pre>
test.rb
require ‘open-uri’
open(‘https://www.google.com/’)
</pre>
I try to set this export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt, but it didn’t work :(
I will appreciate if anyone can point me to the right direction.
Regards
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!
This is most likely due to ruby not finding any up-to-date root certificates. The first thing to do is make sure the ca-certificates package is up-to-date: <pre> sudo apt-get update sudo apt-get install ca-certificates </pre> If that doesn’t work, you can grab the most recent CA bundle file with: <pre> wget http://curl.haxx.se/ca/cacert.pem </pre> Then in your environment.rb file, you can add something like: <pre> ENV[‘SSL_CERT_FILE’] = /path/to/your/new/cacert.pem </pre>
Thank you so much for your help!! this works!! Just by running this: <pre> sudo apt-get install ca-certificates </pre> Regards
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.