Certificate verify failed OpenSSL error when using Ruby 1.9.3
There are lots of moving parts involved in the correct answer. Depends on your OS, Ruby version, OpenSSL version, Rubygems version. I ended up writing an article after researching it. My article explains the reasons for the error, offers steps for further diagnosis, shows several workarounds, and suggests possible solutions. This will be helpful:
OpenSSL Errors and Rails – Certificate Verify Failed
There are also links to the relevant commits and issues on GitHub.
ruby-1.9.3-p125 ssl error
I'm running osx lion 10.7.4
my openssl version was OpenSSL 1.0.0f and i needed to update to 1.0.1
I did this by following this guide:
http://railsapps.github.com/openssl-certificate-verify-failed.html
This was the solution that worked for me:
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz.asc
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz
gpg --verify openssl-1.0.1b.tar.gz.asc
tar xvzf openssl-1.0.1b.tar.gz
cd openssl-1.0.1b
perl ./Configure shared zlib --prefix=/opt/local darwin64-x86_64-cc
make
make test
sudo make install
OpenSSL trouble with Ruby 1.9.3
I had the same problem connecting to an authorization gateway. In the end I was able to connect by forcing sslv3
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if @is_https
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @is_https
http.ssl_version = :SSLv3
How do I avoid the SSL error using hipchat-api on Ruby 1.9.3?
I Just downgraded the httparty gem to a older version(0.11.0) and that worked for me.
On ruby-1.9.3 getting OpenSSL::SSL::SSLError from net-https (Mac OSX 10.6)
I just directly modify the http.rb source(L:669) for MacOS:
def use_ssl=(flag)
flag = flag ? true : false
if started? and @use_ssl != flag
raise IOError, "use_ssl value changed, but session already started"
end
if flag && !@ca_file //added by riceball
@ca_file = '/opt/local/share/curl/curl-ca-bundle.crt'
end
must install first
port install curl-ca-bundle
SSL Error When Making New Rails Project
After a bit of Googling, I came across a guide which shows you how to add the right SSL Cert file (which turned out to be the problem):
https://gist.github.com/fnichol/867550
Related Topics
Gem Install Permission Problem
How to Set Up the Database.Yml File in Rails
What Evaluates to False in Ruby
How to Create a Sha1 Hash in Ruby
Using Layouts in Haml Files Independently of Rails
String.Force_Encoding() in Ruby 1.8.7 (Or Rails 2.X)
Why Do Two Strings Separated by Space Concatenate in Ruby
Ruby: How to Write Multi-Line String With No Concatenation
How to Check If a File Is Being Used by Other Application
The Class/Object Paradox Confusion
In Ruby, How Does Coerce() Actually Work
Why Does Ruby'S 'Gets' Includes the Closing Newline
How to Get Rid of Non-Ascii Characters in Ruby
Unzip (Zip, Tar, Tag.Gz) Files With Ruby
What Is a Regex to Match a String Not At the End of a Line
Getting a "Bad Interpreter" Error When Using Brew
Gem Eventmachine Fatal Error: 'Openssl/Ssl.H' File Not Found