gnome-network-properties sets $http_proxy incorrectly

Bug #494373 reported by Christophe Dumez
100
This bug affects 16 people
Affects Status Importance Assigned to Milestone
gnome-control-center (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: gnome-control-center

In gnome-network-properties, I select:
- manual proxy configuration
  * check the box: use the same proxy for all protocols
  * Type the HTTP proxy address: proxy.utbm.fr
  * Type the HTTP proxy port: 3128

Then, since my proxy requires authentication, I hit "Details" button and I:
 * Check "Use Authentication"
 * Provide my username and password

Then I press "Close" to exit Details dialog and gnome-network-properties dialog and I open a new terminal:
> echo $http_proxy
http://proxy.utbm.fr:3128

Although it should be:
http://username:<email address hidden>:3128

Note that this worked just fine in previous Ubuntu releases (v9.04 for example) and it is broken since Ubuntu v9.10.

Revision history for this message
Christophe Dumez (hydr0g3n) wrote :

I had a look at the code and it seems that the problem is located here:
50_ubuntu_systemwide_prefs.patch:29

that is to say:
+ /* FIXME: add proxy auth support when a "secure" store for the proxy
+ password is available */
+ proxy_str = g_strdup_printf("%s://%s:%i/", proxy_type, host, port);
+ g_print("p: %s\n", proxy_str);

So, here the string does not include auth information (it is explained in the FIXME).

Regarding gnome-terminal, if the http_proxy environment variable is already defined then it does not attempt to retrieve the proxy information from gconf and define http_proxy variable.

See src/terminal-screen.c:1422
  /* Do we already have a proxy setting? */
  if (g_hash_table_lookup (env_table, "http_proxy") != NULL)
    use_proxy = FALSE;

If I comment these two lines, then my http_proxy variable is defined properly in gnome-terminal (with auth information).

Basically, there are two solutions:
1) The ideal solution would be to add auth support to 50_ubuntu_systemwide_prefs.patch. I don't know if it is possible because apparently a secure store is missing
2) In 50_ubuntu_systemwide_prefs.patch do not attempt to define the http_proxy variable whenever authentication is enabled. At least, applications such as gnome-terminal will define the http_proxy variable correctly (provided that it is not already defined). For other applications, the proxy string without auth information would not work anyway when authentication is required.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

I believe it is fixed in Lucid. Could you please try to reproduce with the development release ? Thanks.

Changed in gnome-control-center (Ubuntu):
status: New → Incomplete
Revision history for this message
Benoit Ebner (ebnerbenoit) wrote :

The bug seems fixed in Lucid.

I would just remark on the screen encoding the proxy. If I chose to manually configure the proxy and I begin with http:// encoding, the following letter removes the http:// (ok), but puts the cursor at the start line. Before the last letter that I encoded. It would be fairer to put the cursor at the end of encoding for the strikes continue without error.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I'm closing this report because it is fixed in lucid and I opened bug 542001 for the input field problem.

Thanks for your help.

Changed in gnome-control-center (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Jayson Reis (jaysonsantos2003) wrote :

I'm using lucid and that appers to not be fixed.
It is in the main line ?

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

@Jayson Reis, please provide a test case to reproduce the error. Thanks.

Revision history for this message
Benoit Ebner (ebnerbenoit) wrote :

@Jean-Baptiste Lallement: When I update my Lucid test machine, I found the bug. You can see bug 544033 to take a test case.
The old test case (in top of this bug) work also.

I do not know what has changed between my test message (2010-03-19) and now. It's quite annoying:)

I can make more test on the latest version of Lucid?

Revision history for this message
Jayson Reis (jaysonsantos2003) wrote :

A simple example. Try to change the proxy and click apply system widely and then open gnome-terminal
sudo -i
echo $http_proxy
the result will be uri without username and password

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

@Benoit: bug 544033 is different. It's about apt.conf not $http_proxy. It's not a duplicate so we'll treat it there.
@Jayson: The original report do not talk about "sudo -i" so it's a new issue. Could you please file a new report. Press CTRL+F2 and enter 'ubuntu-bug gnome-control-center'.

Can someone experiencing the original issue provide the detailed steps to reproduce it. I fail to reproduce it on latest lucid.
Thanks in advance.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I'm reopening this report because I can reproduce on Lucid and it's clearly broken.
username/password are not always exported in *_proxy.
Env variable are created in caps and when the proxy is remove only the *_PROXY are removed from env.
It's somewhat broken.

Changed in gnome-control-center (Ubuntu):
assignee: nobody → Jean-Baptiste Lallement (jibel)
importance: Undecided → Medium
status: Fix Released → In Progress
Revision history for this message
Jayson Reis (jaysonsantos2003) wrote :

That still bugged even in /etc/apt/apt.conf

Here is my apt.conf

Acquire::http::proxy "http://172.16.1.50:3128/";
Acquire::ftp::proxy "ftp://172.16.1.50:3128/";
Acquire::https::proxy "https://172.16.1.50:3128/";

Revision history for this message
David Cooley (n5xmt) wrote :

This bug also affects me with Lucid.
The proxy user/password are not added to the http_proxy, ftp_proxy or https_proxy anywhere.
I have to manually add them later.

Revision history for this message
Bertrand Presles (bpresles) wrote :

I confirm this bug in Maverick (10.10) too.

How to reproduce it:

1) Launch gnome-network-properties
2) Select "Manual configuration"
3) Enter proxy host and port
4) Click 'Details' button to enter authentication data
5) In the details popup select "Use authentication" and enter username and password
6) Click Apply to system widely

Then look at:

- /etc/environment
- /etc/apt/apt.conf

Current configuration:

- /etc/environment:

http_proxy="http://myproxy:3128/"

- /etc/apt/apt.conf:

Acquire::http::proxy "http://myproxy:3128/"

Expected configuration:

- /etc/environment:

http_proxy="http://username:password@myproxy:3128/"

- /etc/apt/apt.conf:

Acquire::http::proxy "http://username:password@myproxy:3128/"

Revision history for this message
Andrea Lazzarotto (Lazza) (andrea-lazzarotto) wrote :

Not sure about this but, since it's a usability issue, could we mark it as a papercut?

Changed in gnome-control-center (Ubuntu):
assignee: Jean-Baptiste Lallement (jibel) → nobody
status: In Progress → Triaged
Revision history for this message
Brian McDevitt (brian-p-mcdevitt) wrote :

Bug still present in 11.04 Beta 2.

Revision history for this message
Hakan GÜVEN (hhguven) wrote :

it is still present in 11.04 production.

since i am visiting several customers, i need to save their proxy information. Although i saved the authentication credentials, it does not do any good and i t makes me to ask customer to enter the username/password every time, for each different browser, mail client, synaptic like tools which is not a good way.

gnome-network-propeties takes all the required parameters, host, port, username, password but sets proxy only as host:port. It should be a one line of code to fix just by adding username:password@host:port. I hope it will be patched as soon as possible.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The dialog has been deprecated and rewritten in GNOME3 and Oneiric, closing the bug

Changed in gnome-control-center (Ubuntu):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.