hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabien Guironnet <fg.j...@free.fr>
Subject NTLM Proxy Authentication : still receiving 407
Date Thu, 24 Apr 2003 18:19:04 GMT
  Hello,

I'm trying to authenticate with an NTLM Proxy server (SQUID 2.5), but I 
still get the error message :
24 avr. 2003 19:39:23 org.apache.commons.httpclient.HttpMethodBase 
processAuthenticationResponse
INFO: Already tried to authenticate to 
"www.google.com#TlRMTVNTUAACAAAABAAEACgAAACCgkEAu3QkmX3Fo24AAAAAAAAAAExZT04=" 
but still receiving 407.

I don't think the problem come from Squid because I can use IE and NTLM 
Authorization Proxy Server 0.9.7 (Python) from Dmitry A. Rozmanov.
I've tested the 3 NTLM messages generated by HTTPClient (with NTLM 
Authorization Proxy Server) and they seems to be OK.
Can the problem come from a connection that isn't keeped alive? or I 
don't use the HTTPClient correctly?

Here is my code (I've tried HTTPClient package 2.0 Alpha 3 (20030225) 
and the nightly source drop from 20030423) :
///////////////////////// BEGIN ///////////////////////////////

import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import java.io.IOException;

public class Test{

    public static void main(String[] arg) {   
        HttpState state = new HttpState();
        HttpClient client = new HttpClient();
        NTCredentials cred = new NTCredentials("nom_utilisateur", 
"mot_passe", "192.168.0.1", "DOMAINE");
        HostConfiguration host = new HostConfiguration();
        HttpMethod method = new GetMethod();
       
        host.setProxy("192.168.0.2", 3128);
        host.setHost("www.google.com", 80, "http");
        client.setHostConfiguration(host);
        client.getState().setProxyCredentials(null, cred);
               
        try {
            client.executeMethod(method);
            System.out.println(method.getStatusCode() + "\n" + 
method.getResponseBodyAsString());
        } catch (IOException e) {
            System.out.println("IOException : " + e.getMessage());
            return;
        }
    }
}

/////////////////////////////// END /////////////////////////////////



Thanks for your help!

    Fabien


Mime
View raw message