Q:

SSL server certificate error

I am trying to hit an api to fetch data but getting this error:
`connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

This is how I am doing it:
require 'open-uri'
require 'json'

result = JSON.parse(open("https://xxx.xx.xx.:xxxx/xxx/xxx", :http_basic_authentication=>['username', 'password']).read)
puts "#{result}"

How to get rid of this?

A:

perhaps you have to force, ssl certificat validation OFF, like : 
require 'open-uri'
require 'json'
require 'openssl'

result = JSON.parse(open("your URL in HTTPS", {:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE, :http_basic_authentication=>['username', 'password']}).read)

puts "#{result}"

