Recently,our project has been undergoing process changes and some integration tools has been introduced, for example Hudson,Sonatype Nexus,Maven.According to the company's policy,we have to access the internet via the proxy settings.But the current Sonatype Nexus is using the httpclient 3 to do auth which only sopport NTLMv1.
I have tried the url NTLM Proxy Authentication and Jakarta HttpClient but still the application can not access the internet though proxy.After googling, I found that the Httpclient 4 supports NTLMv2 out of the box. You can find the details by the following url: http://hc.apache.org/httpcomponents-client-ga/ntlm.html. Meanwhile,It seems that someone suggests using CNTLM and after some configuration and find It really works for Nexus.
First,get the latest version of CNTLM and install it according to the guide. you can configure it as below.
1. As I configure it at home,you can get a proxy here and add it in cntlm.ini like this: Proxy 219.159.234.179:8080,you can leave the username pass and domain there and donot change anything if you donot have one.
2. start the cntlm service mannually or change the dir to the cntlm installation directory and run the command
ntlm -v to see whether cntlm works fine or not.
3. configure the proxy in the nexus,suppose the Listen Port defaut 3128,set the Proxy Host 127.0.0.1 and Port 3128,if you have username and pass and domain,please set it in cntlm.ini and need not configure it in the nexus.
4, Nexus can now get access to the internet via proxy,you can browse Views/Repositories --> Maven Central -> Browse Remote to see whether It works or not.
5. the log of nexus looks like below, It's for your ref.
2010-12-17 19:12:42 INFO [080-Processor21] - o.s.n.c.a.DefaultNe~ - Applying Nexus Configuration...
2010-12-17 19:12:42 INFO [080-Processor21] - o.s.n.c.v.DefaultAp~ - Nexus configuration validated succesfully.
2010-12-17 19:13:02 INFO [ool-2-thread-15] - o.s.n.p.s.r.c.Commo~ - Remote storage settings change detected for ProxyRepository ID="central" ("Maven Central"), updating HttpClient...
2010-12-17 19:13:02 INFO [ool-2-thread-15] - o.s.n.p.s.r.c.Commo~ - ... proxy setup with host "127.0.0.1"
2010-12-17 19:13:02 INFO [080-Processor21] - o.s.n.p.s.r.c.HttpC~ - ... proxy setup with host "127.0.0.1"
6.Another tool which can help you get access to internet via proxy is ntlmaps.
Ref
NTLM Proxy Authentication and Jakarta HttpClient
http://www.theresearchkitchen.com/blog/archives/23
NTLM support in HttpClient
http://hc.apache.org/httpcomponents-client-ga/ntlm.html
Cntlm Authentication Proxy
http://cntlm.sourceforge.net/
NTLM Authorization Proxy Server
http://ntlmaps.sourceforge.net/
http://linux.chinaunix.net/bbs/viewthread.php?tid=227822
|