backport r36476

backport http://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/36476 to make Net::HTTP respect http_proxy environment variables.