GET HTTPS request with Ruby 2.3.0

Hi,

I’m stuck with an error when I try to do a get request.
Message:
`connect_nonblock’: SSL_connect returned=1 errno=0 state=error:
certificate verify failed (OpenSSL::SSL::SSLError)

This was my code:

uri = URI(link)
Net::HTTP.start(uri.host, uri.port,
:use_ssl => uri.scheme == ‘https’) do |http|
request = Net::HTTP::Get.new uri

response = http.request request # Net::HTTPResponse object
puts response.body
end

Have anyone else gotten the same connection error before?

//EDIT:
Found my answer.
I needed to add:

require ‘openssl’
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE