Forum: Ruby Nuby: using net/http*s* from behind a proxy server

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
on 2007-07-14 00:37
(Received via mailing list)
Hey All,

I've had reasonable luck using net/http from behind a proxy server
here at work, but now I need to draw down SSL-encrypted pages via
https.  Here's my latest, unsuccessful attempt:

# -------------------------------
require "uri"
require "net/https"

uri = URI.parse("


ghc_proxy.start(, uri.port) do |sess|
   sess.use_ssl = true
   puts("in block")
# -------------------------------

That gets me one of these here:

c:/ruby/lib/ruby/1.8/net/https.rb:121:in `use_ssl=': use_ssl value
changed, but session already started (IOError)

If I try to call .use_ssl= on my ghc_proxy object, I get:

undefined method `use_ssl=' for #<Class:0x2b3b030> (NoMethodError)

(Bonus question: shouldn't ghc_proxy be an instance of Net::HTTP, and
not Class, as seems to be indicated by that message?)

Can anybody give me a hint on this?  I'm using ruby 1.8.6 on windows.


Mario R. (Guest)
on 2013-12-10 15:22
could you solve this problem?
This topic is locked and can not be replied to.