0

I'm trying to use ruby to do a search based on account 1234, but I keep getting an SSL_connect returned=1 errno=0 certificate error. The site is signed, but for some reason Ruby doesn't like it. The certificate is properly signed, so I'm not sure why it's rejecting it.

require 'net/http'

uri = URI("https://secure.domain.com/api/account/1234?api_key"+key)
response = Net::HTTP.get(uri)
puts response.body #this must show the JSON contents

Based on another suggestion I also tried, but received the same error.

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
end
Jacobm001
  • 4,431
  • 4
  • 30
  • 51

1 Answers1

0

Turns out the error was due to Windows not having support for something like OpenSSL built in. After installing the appropriate binaries onto the system it worked without error.

Jacobm001
  • 4,431
  • 4
  • 30
  • 51