Project

General

Profile

Actions

Feature #12921

closed

Retrieve user and password for proxy from env

Added by wolfer (Sergey Fedosov) almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:78075]

Description

If ENV['http_proxy'] have some like 'http://user:password@192.168.1.1:3128' Net::HTTP will send request throught proxy without user and pass and proxy response with "407 Proxy authentication required"

I'm read discussion in #10652, but reason for reverting seems to me a little strange.

Mr. Tanaka wrote that other utils allow storing password in configuration file and "I think the missing piece is a library for password store for storing passwords in a file.".
But ruby has no similar file. Set http_proxy env is standard way for define proxy configuration, with credential too. Most popular utils, application and language allow that variant. Ruby is said to follow the principle of least astonishment (POLA), isn't ? Why not make the behavior of a ruby least surprising?

Otherwise the programmer has to create custom server-specific configuration logic(in most cases the trash). Any gems do not support setup proxy setting and therefore it is necessary to monkey-patching... It's look like dirty hack rather than following standarts.

P.S. sorry for my english. GT rules


Files

proxy_credential_from_env.patch (617 Bytes) proxy_credential_from_env.patch wolfer (Sergey Fedosov), 11/10/2016 11:30 AM

Related issues

Related to Ruby master - Feature #10652: Automatic detection of user and password from envClosedayumin (Ayumu AIZAWA)12/25/2014Actions
Related to Ruby 1.8 - Bug #435: open-uri.rb 407 Proxy Authentication Required (OpenURI::HTTPError)Rejected08/13/2008Actions
Related to Ruby master - Bug #4388: open-uriで環境変数http_proxyを使うときに認証付きのProxyが使えませんRejectedActions
Is duplicate of Ruby master - Feature #6546: Net::HTTP to check for HTTP_PROXY environment setting.Closednaruse (Yui NARUSE)06/04/2012Actions
Actions

Also available in: Atom PDF