commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pauline CANTALOUP" <Pauline.CANTAL...@123multimedia.com>
Subject RE: [HTTPClient] Problems to connect to a proxy
Date Mon, 30 May 2005 16:54:47 GMT

Unfortunately, it seems it doesn't work :(
Anyway, thanks a lot and sorry again !

-----Message d'origine-----
De : Oleg Kalnichevski [mailto:olegk@apache.org] 
Envoyé : lundi 30 mai 2005 17:33
À : Jakarta Commons Users List
Objet : Re: [HTTPClient] Problems to connect to a proxy

Pauline,

This should do the trick

HttpClient client = new HttpClient();
List authPrefs = new ArrayList(2);
authPrefs.add(AuthPolicy.DIGEST);
authPrefs.add(AuthPolicy.BASIC);
// This will exclude the NTLM authentication scheme
client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY,
authPrefs);

For details see:

http://jakarta.apache.org/commons/httpclient/3.0/authentication.html#Alternat
e%20authentication

Oleg

On Mon, May 30, 2005 at 05:18:21PM +0200, Pauline CANTALOUP wrote:
> Thanks, but how can I force basic auth ? 
> 
> -----Message d'origine-----
> De : Oleg Kalnichevski [mailto:olegk@apache.org] Envoy? : lundi 30 mai 
> 2005 15:26 ? : Jakarta Commons Users List Objet : Re: [HTTPClient] 
> Problems to connect to a proxy
> 
> Pauline,
> 
> As far as I can tell all the requests generated by HttpClient look 
> perfectly sane. The server simply does not seem to like the 
> credentials supplied by the client. Are you sure you are using the 
> correct user name / password / domain / host params? Any of these four 
> params being invalid will cause the NTLM scheme to fail.
> 
> Actually this is the very time I see Squid proxy configured to use 
> NTLM authentication. Frankly, I do not know if HttpClient is 
> compatible with squid's implementation of NTLM auth. Consider using 
> BASIC auth, at least initially, to test the credentials
> 
> Oleg
> 
> >> "GET http://www.yahoo.fr/ HTTP/1.1[\r][\n]"
> >> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]"
> >> "Host: www.yahoo.fr[\r][\n]"
> >> "Proxy-Connection: Keep-Alive[\r][\n]"
> >> "[\r][\n]"
> 
> << "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
> << "Server: squid/2.5.STABLE9[\r][\n]"
> << "Mime-Version: 1.0[\r][\n]"
> << "Date: Mon, 30 May 2005 12:40:47 GMT[\r][\n]"
> << "Content-Type: text/html[\r][\n]"
> << "Content-Length: 1462[\r][\n]"
> << "Expires: Mon, 30 May 2005 12:40:47 GMT[\r][\n]"
> << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
> << "Proxy-Authenticate: NTLM[\r][\n]"
> << "Proxy-Authenticate: Basic realm="Squid proxy-caching web
server"[\r][\n]"
> << "X-Cache: MISS from ProxyA[\r][\n]"
> << "Proxy-Connection: close[\r][\n]"
> 
> >> "GET http://www.yahoo.fr/ HTTP/1.0[\r][\n]"
> >> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]"
> >> "Proxy-Authorization: NTLM
> >>
TlRMTVNTUAABAAAABlIAAAMAAwAsAAAADAAMACAAAABQQy1DQU5UQUxPVVBUTFM=[\r][\n]"
> >> "Host: www.yahoo.fr[\r][\n]"
> >> "Proxy-Connection: Keep-Alive[\r][\n]"
> >> "[\r][\n]"
> 
> << "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
> << "Server: squid/2.5.STABLE9[\r][\n]"
> << "Mime-Version: 1.0[\r][\n]"
> << "Date: Mon, 30 May 2005 12:40:47 GMT[\r][\n]"
> << "Content-Type: text/html[\r][\n]"
> << "Content-Length: 1462[\r][\n]"
> << "Expires: Mon, 30 May 2005 12:40:47 GMT[\r][\n]"
> << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
> << "Proxy-Authenticate: NTLM
> TlRMTVNTUAACAAAAAAAAADAAAAASAgAAE+F7GZvD+bAAAAAAAAAAAAAAAAAwAAAA[\r][\n]"
> << "X-Cache: MISS from ProxyA[\r][\n]"
> << "Proxy-Connection: keep-alive[\r][\n]"
> 
> >> "GET http://www.yahoo.fr/ HTTP/1.0[\r][\n]"
> >> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]"
> >> "Proxy-Authorization: NTLM
> >> TlRMTVNTUAADAAAAGAAYAGAAAAAAAAAAeAAAAAMAAwBAAAAAEQARAEMAAAAMAAwAVAA
> >> AA
> >> AAAAAB4A
> >> AAABlIAAFRMU1BBVUxJTkUuQ0FOVEFMT1VQUEMtQ0FOVEFMT1VQA/uQagaqmRXdJR+B
> >> Bq
> >> xQ4gMONR
> >> a81Qhc[\r][\n]"
> >> "Host: www.yahoo.fr[\r][\n]"
> >> "Proxy-Connection: Keep-Alive[\r][\n]"
> >> "[\r][\n]"
> 
> << "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
> << "Server: squid/2.5.STABLE9[\r][\n]"
> << "Mime-Version: 1.0[\r][\n]"
> << "Date: Mon, 30 May 2005 12:40:47 GMT[\r][\n]"
> << "Content-Type: text/html[\r][\n]"
> << "Content-Length: 1462[\r][\n]"
> << "Expires: Mon, 30 May 2005 12:40:47 GMT[\r][\n]"
> << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
> << "Proxy-Authenticate: NTLM[\r][\n]"
> << "Proxy-Authenticate: Basic realm="Squid proxy-caching web
server"[\r][\n]"
> << "X-Cache: MISS from ProxyA[\r][\n]"
> << "Proxy-Connection: close[\r][\n]"
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> 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,
> 
> 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 subsidiari
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message