hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "collier.matthew" <collier.matt...@gmail.com>
Subject HTTPClient 4.1 Alpha 1 and NTLM Proxy
Date Mon, 04 Jan 2010 00:32:13 GMT

I hope someone can help me with this one.

I'm trying to access an HTTP target through a NTLM authenticated squid proxy

        client.getAuthSchemes().register("ntlm", new NTLMSchemeFactory());
        NTCredentials ntCreds = new NTCredentials(proxyUserName,
config.getTNIPassword(), config.getTNIProxyAddress(), "DOMAIN");
        AuthScope scope = new AuthScope(AuthScope.ANY_HOST,
AuthScope.ANY_PORT, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME);
        client.getCredentialsProvider().setCredentials(scope, ntCreds);
        targetHost = new HttpHost(logonSite, logonPort, logonProtocol);
        HttpHost proxy = new HttpHost(config.getTNIProxyAddress(),

I attempt to make a get request to my target server.  Console log (level 5):

network: Connecting http://x.x.14.3:3128/ with proxy=DIRECT
network: Connecting http://x.x.14.3:3128/ with proxy=DIRECT
network: Connecting http://x.x.14.3:3128/ with proxy=DIRECT
network: Connecting http://x.x.14.3:3128/ with proxy=DIRECT
Method failed: HTTP/1.0 407 Proxy Authentication Required

First off, the aforementioned IP address is the IP for my proxy server, not
the target host.  Is this normal?

I don't know if there is an authentication failure or what.  I have tried
prefixing my username with "DOMAIN\" with no benefit.

I have implemented the JCIFS NTLM authentication as recommended on the
HttpClient website.

I had to alter the JCIFSEngine.java example code provided as it will not

Apparently the constructors for the Type3Message object have changed in
jcifs-1.3.12.jar.  I am simply using:

Type3Message t3m = new Type3Message(t2m);

Instead of:

        Type3Message t3m = new Type3Message(

I don't know if this has anything to do with it.

In researching alternatives, I discovered that the java.net library includes
NTLM authentication.   Can HttpClient take advantage of this instead of the
now unsupported aspect of the JCIFS package?

Any assistance is greatly appreciated!

View this message in context: http://old.nabble.com/HTTPClient-4.1-Alpha-1-and-NTLM-Proxy-tp27007331p27007331.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message