commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pauline CANTALOUP" <>
Subject [HTTPClient] Problems to connect to a proxy
Date Mon, 30 May 2005 12:24:48 GMT

I have to connect to a proxy in order to reach a website. So I wrote :
        try {
            HttpClient client = new HttpClient();
            HostConfiguration hostConfig=new HostConfiguration();

            NTCredentials ntc=new
            GetMethod method = new GetMethod(url);

            // Execute the GET method
            int statusCode = client.executeMethod(method);
            if (statusCode != -1) {
                String contents = method.getResponseBodyAsString();
        } catch (Exception e) {
In traces, I readed : "INFO: ntlm authentication scheme selected" so I
supposed the library choose the authentication type by itself. But then I
have this error :

30 mai 2005 14:02:04 org.apache.commons.httpclient.HttpMethodDirector
INFO: Failure authenticating with NTLM <any realm>@

I thought it was perhaps a problem of encryption so I added :

        try {
        String secProviderName = "com.sun.crypto.provider.SunJCE"; secProvider = 
        }catch(Exception e) {

But nothing changed. The man who manages proxy said he didn't see my request
for authentication. 
So what could I try ?
Thanks in advance for your help !

Pauline Cantaloup
123 Multimédia
Service mobilité 

Décharge / Disclaimer 

Ce message et toutes les pièces jointes (ci-après le "message") sont confidentiels et établis
à l'intention exclusive des destinataires. Toute utilisation ou diffusion non autorisée
est interdite. Tout message électronique étant susceptible d'altération, 123Multimédia
et ses filiales déclinent toute responsabilité au titre de ce message s'il a été altéré,
déformé ou falsifié.

This message and any attachments (the "message") are confidential and intended solely for
the addressees. Any unauthorised use or dissemination is prohibited. E-mails are susceptible
to alteration. Therefore neither 123Multimédia nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message