Rails: Open HTTP URL From HTTPS site

Posted by Imran on Stack Overflow See other posts from Stack Overflow or by Imran
Published on 2010-04-26T16:31:31Z Indexed on 2010/04/26 16:33 UTC
Read the original article Hit count: 521

Filed under:
|
|
|

I have a rails application running on SSL. I also have setup Piwik (for analytics) and it is running non-secure i.e. HTTP. When I try to make a call to Piwik API from my ruby code (the application running on SSL) it gives me the following error:

SocketError (getaddrinfo: Name or service not known): /usr/lib/ruby/1.8/net/http.rb:560:in initialize' /usr/lib/ruby/1.8/net/http.rb:560:inopen' /usr/lib/ruby/1.8/net/http.rb:560:in connect' /usr/lib/ruby/1.8/timeout.rb:53:intimeout' /usr/lib/ruby/1.8/timeout.rb:93:in timeout' /usr/lib/ruby/1.8/net/http.rb:560:inconnect' /usr/lib/ruby/1.8/net/http.rb:553:in do_start' /usr/lib/ruby/1.8/net/http.rb:542:instart' /usr/lib/ruby/1.8/net/http.rb:379:in get_response' app/controllers/piwik_charts_controller.rb:195:inmake_graph'

It works perfect when I make call from an application running on HTTP.

Please advise.

Thanks, Imran

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about open-uri