Rails: Open HTTP URL From HTTPS site
- by Imran
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