Ruby on Rails Thursday, August 29, 2013

Hi guys

when I execute the piece of code bellow on RoR console it works fine:

url = URI.parse("https://us1.api.mailchimp.com/2.0/helper/ping")
request = Net::HTTP::Post.new(url.path)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request.body = "{\"apikey\": \"myapikey\"}"

response = http.start {|http| http.request(request) }


But when I try to use it on my RoR app I get the following error:

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=unknown
state: sslv3 alert handshake failure)

Someone know what could be happening?

Thank you all in advance!

Best regards

Paulo

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b7472c6fe9b75962b1a1982bc035643f%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment