From: "toch (Christophe Philemotte)" Date: 2014-01-09T06:49:08+09:00 Subject: [ruby-core:59650] [ruby-trunk - Bug #9385][Open] open-uri always uses proxy set as env var even if proxy flag is set to nil Issue #9385 has been reported by toch (Christophe Philemotte). ---------------------------------------- Bug #9385: open-uri always uses proxy set as env var even if proxy flag is set to nil https://bugs.ruby-lang.org/issues/9385 Author: toch (Christophe Philemotte) Status: Open Priority: Normal Assignee: akr (Akira Tanaka) Category: lib Target version: current: 2.2.0 ruby -v: 2.0.0p247 Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN According to doc http://ruby-doc.org/stdlib-2.1.0/libdoc/open-uri/rdoc/OpenURI.html we can disable the proxy by doing open("http://www.ruby-lang.org/en/raa.html", :proxy => nil) and "environment variables for proxy are ignored and connection will be made to a server directly". But it is not. The environment variable is still considered and used (cf attached script and logs). After digging the code, I think it's because Net::HTTP.new is called without passing p_addr to nil. If I'm not wrong, the attached patch is a possible solution to fix it. -- http://bugs.ruby-lang.org/