SSL errors with open()

I have web site that open ok in the browser - no errors or warnings
the certificate. When I open it with open(), I get the following error:

`SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
certificate verify failed’ (OpenSSL::SSL::SSLError)

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:852:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:318:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:736:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:211:in
`block in open_loop’

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:209:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:209:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:150:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:716:in

from /Users/joe/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/open-uri.rb:34:in

from t.rb:13:in `’

raise exception

Trying another SSL enabled site ( works ok.

Any ideas here?



It is possible you do not have a fully up to date root certificate list,
root certificates are stores in the browser, but OpenSSL uses its own

Since you are using rvm on OS X by the look of it, so you may want to
the following command to see if this helps

rvm osx-ssl-certs update

I updated the SSL certs as you suggested, I still get a failure.

There is a workaround: add these 2 lines to the top of your program:



The SSL library prints a warning, but it will run.

Agreed it will run, but it has obviously removed all the protection :slight_smile:

Very interested that it works in a browser however

Sent from my iPhone