add ntlm (MS) proxy support (wishlist)

Bug #137418 reported by marcelo
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Opinion
Undecided
Unassigned

Bug Description

Binary package hint: apt

I'm using Ubuntu Feisty Fawn 7.04 in my computer at work. The computer is behind a internet firewall (http://9.9.9.9:3128).
The problems was:

I have to log into the proxy server using a DOMAIN + username + server + port

Ive tried to configure in this ways:
  - Menu : system > preferences > proxy
  - Synaptic: preferences > proxy server > proxy http [9.9.9.9 + 3128] + authentication [ DOMAIN\username + password]
  - Exporting the string http+proxy to the environment

Nothing was working. In all cases, was returning: 407 Proxy Authentication Required

But in last search, i found the package
http://packages.ubuntu.com/feisty/web/ntlmaps

This is a local proxy that listen in a local port (in my case: 1080) that connects to proxy 9.9.9.9:3128 using NT authentication (DOMAIN + USER + PASSWORD)

But after installing the package using the link above, i need to follow these steps:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

1 - Change the file /etc/ntlmaps/server.cfg using the following parameters:

LISTEN_PORT: 1080
PARENT_PROXY: 9.9.9.9
PARENT_PROXY_PORT: 3128
NT_DOMAIN: DOMAIN
USER: myuser
PASSWORD: mypasswsord

#Note: NT_HOSTNAME is empty!

2 - Change the file /usr/share/ntlmaps/main.py. The last parameter of the calling of function findConfigFileNameInArgv was changed:

conf = config_ntlmaps.read_config(config_ntlmaps.findConfigFileNameInArgv(sys.argv, '/etc/ntlmaps/'))
#note the fixed string '/etc/ntlmaps/'

3 - Execute the following command in a terminal:
export http_proxy=127.0.0.1:1080

4 - Execute another command to restart the ntlmaps server:
/etc/init.d/ntlmaps stop
/etc/init.d/ntlmaps restart

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Finally i could use my apt-get via terminal.

Best regards!

Marcelo Amorim Ferreira
Uberlândia - Minas Gerais
Brasil [<o>]

Tags: patch
Revision history for this message
Adam Niedling (krychek) wrote :

Feisty is not supported anymore.

Changed in apt:
status: New → Invalid
Revision history for this message
Chad Waters (chad) wrote :

Contrary to the subject, this is not feisty specific.

If your must close this bug, please unlink mine ( 137800 ) as a dupe.

Thanks
Chad

Changed in apt:
status: Invalid → Confirmed
Revision history for this message
Adam Niedling (krychek) wrote :

Could you update the Bug summary/description then?

Revision history for this message
Chad Waters (chad) wrote :

This was the description from my bug marked as a dupe Bug #137800

Binary package hint: apt

Please add NTLM (MS) proxy support to apt.

Currently the Acquire::http::Proxy parameter is incompatible with the domain\username syntax.

That proxy I used as a test was MS ISA I get the following with all attempts:
 "( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. )"

See also:
 https://lists.ubuntu.com/archives/ubuntu-us-pa/2007-September/000262.html

Revision history for this message
Chad Waters (chad) wrote :

I just tested with:

apt/intrepid uptodate 0.7.14ubuntu6

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/intrepid/main/binary-i386/Packages.gz 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) [IP: X 8080]

Revision history for this message
mauri300856 (maurizio-salviato) wrote :

Hi.
Same problem with 8.04.1.
i'm using an Isa server proxy.
I installed ntlmaps and it's good for Firefox, but i'm not able to apt-get update by Update manager. I entered all the informations (proxy, port (8080), userid, password) in Synaptics Packages Manager but it doesn't work.
I receive a 407 proxy.......
All is fine if i use a Squid proxy (with userid+password+port 8080)

Best regards.

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
status: Fix Released → Confirmed
Revision history for this message
Nelson Benitez (gnel) wrote :

Hi, this bug prevents me from using ubuntu/debian from my workplace where my employer uses a NTLM proxy authentication to reach the internet, I had the same problem with fedora and its yum package manager, in fedora they use curl to download http requests so adding NTLM support was just a one-liner patch, see:

https://bugzilla.redhat.com/show_bug.cgi?id=769254#c3

whereas in debian/ubuntu apt-get uses a custom c++ implementation of http protocol[1] so adding NTLM proxy authentication support is a non trivial issue, on the other hand apt uses libcurl for https requests[2] so I will send the one-liner patch to support it.

The solution for this bug would be:

- Port http download code to libcurl, same way https code is already using it.
- As a workaround till prior step is done the ntlmaps package[3] should be included by default in debian/ubuntu so any user behind a NTLM authenticated proxy can *use* apt-get to install/update any package.

[1] http://anonscm.debian.org/loggerhead/apt/debian-sid/annotate/head:/methods/http.cc

[2] http://anonscm.debian.org/loggerhead/apt/debian-sid/annotate/head:/methods/https.cc

[3] http://packages.ubuntu.com/feisty/web/ntlmaps

Thanks,

Revision history for this message
Nelson Benitez (gnel) wrote :

As mentioned in my above comment, because apt uses libcurl for accessing https urls, we can easily have support for NTLM and several other proxy authentication methods [1] thanks to libcurl.

It is a pity that the http code in contrast does not use libcurl.

[1] http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHTTPAUTH

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix NTLM proxy authentication for https destination urls" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Julian Andres Klode (juliank) wrote :

We will not add support for NTLM proxies in APT.

Changed in apt (Ubuntu):
status: Confirmed → Opinion
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.