>Exactly what does not work? I know for a fact that Squid BASIC authentication >works, because I regularly test HttpClient against Squid. >I am also pretty sure that the code snippet I posted below should work
Sorry if I wasn't clear, your code works, but authentication doesn't, even basic one - but I'm sure of login/password since I use them everyday to log on my workstation ; moreover, when I set proxy in System properties and try a simple URL.openStream, it works. 2005/05/31 09:17:19:974 CEST [DEBUG] HttpClient - Java version: 1.5.0_01 2005/05/31 09:17:19:990 CEST [DEBUG] HttpClient - Java vendor: Sun Microsystems Inc. 2005/05/31 09:17:19:990 CEST [DEBUG] HttpClient - Java class path: C:\eclipse\workspace\CheckHeaders\webapp\WEB-INF\classes;C:\eclipse\workspace \CheckHeaders\webapp\WEB-INF\lib\commons-logging.jar;C:\eclipse\workspace\Che ckHeaders\webapp\WEB-INF\lib\commons-httpclient-3.0-rc2.jar;C:\eclipse\worksp ace\CheckHeaders\webapp\WEB-INF\lib\commons-codec-1.3.jar 2005/05/31 09:17:19:990 CEST [DEBUG] HttpClient - Operating system name: Windows XP 2005/05/31 09:17:19:990 CEST [DEBUG] HttpClient - Operating system architecture: x86 2005/05/31 09:17:19:990 CEST [DEBUG] HttpClient - Operating system version: 5.1 2005/05/31 09:17:20:365 CEST [DEBUG] HttpClient - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores) 2005/05/31 09:17:20:365 CEST [DEBUG] HttpClient - SunRsaSign 1.5: Sun RSA signature provider 2005/05/31 09:17:20:365 CEST [DEBUG] HttpClient - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) 2005/05/31 09:17:20:365 CEST [DEBUG] HttpClient - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC) 2005/05/31 09:17:20:365 CEST [DEBUG] HttpClient - SunJGSS 1.0: Sun (Kerberos v5) 2005/05/31 09:17:20:365 CEST [DEBUG] HttpClient - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5) 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.useragent = Jakarta Commons-HttpClient/3.0-rc2 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.protocol.version = HTTP/1.1 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.protocol.cookie-policy = rfc2109 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.protocol.element-charset = US-ASCII 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.protocol.content-charset = ISO-8859-1 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.method.retry-handler = [EMAIL PROTECTED] 2005/05/31 09:17:20:380 CEST [DEBUG] DefaultHttpParams - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z] 2005/05/31 09:17:20:396 CEST [DEBUG] DefaultHttpParams - Set parameter http.auth.scheme-priority = [Digest, Basic] 2005/05/31 09:17:20:505 CEST [DEBUG] HttpConnection - Open connection to 192.168.10.225:8888 2005/05/31 09:17:21:162 CEST [DEBUG] header - >> "GET http://www.yahoo.fr/ HTTP/1.1[\r][\n]" 2005/05/31 09:17:21:162 CEST [DEBUG] HttpMethodBase - Adding Host request header 2005/05/31 09:17:21:177 CEST [DEBUG] header - >> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]" 2005/05/31 09:17:21:177 CEST [DEBUG] header - >> "Host: www.yahoo.fr[\r][\n]" 2005/05/31 09:17:21:177 CEST [DEBUG] header - >> "Proxy-Connection: Keep-Alive[\r][\n]" 2005/05/31 09:17:21:177 CEST [DEBUG] header - >> "[\r][\n]" 2005/05/31 09:17:21:177 CEST [DEBUG] header - << "HTTP/1.0 407 Proxy Authentication Required[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Server: squid/2.5.STABLE9[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Mime-Version: 1.0[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Date: Tue, 31 May 2005 07:17:21 GMT[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Content-Type: text/html[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Content-Length: 1462[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Expires: Tue, 31 May 2005 07:17:21 GMT[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Proxy-Authenticate: NTLM[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Proxy-Authenticate: Basic realm="Squid proxy-caching web server"[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "X-Cache: MISS from ProxyA[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] header - << "Proxy-Connection: close[\r][\n]" 2005/05/31 09:17:21:193 CEST [DEBUG] HttpMethodDirector - Authorization required 2005/05/31 09:17:21:193 CEST [DEBUG] AuthChallengeProcessor - Supported authentication schemes in the order of preference: [Digest, Basic] 2005/05/31 09:17:21:193 CEST [DEBUG] AuthChallengeProcessor - Challenge for Digest authentication scheme not available 2005/05/31 09:17:21:193 CEST [INFO] AuthChallengeProcessor - Basic authentication scheme selected 2005/05/31 09:17:21:208 CEST [DEBUG] AuthChallengeProcessor - Using authentication scheme: basic 2005/05/31 09:17:21:208 CEST [DEBUG] AuthChallengeProcessor - Authorization challenge processed 2005/05/31 09:17:21:208 CEST [DEBUG] HttpMethodDirector - Proxy authentication scope: BASIC 'Squid proxy-caching web server'@192.168.10.225:8888 2005/05/31 09:17:21:208 CEST [DEBUG] HttpMethodDirector - Retry authentication 2005/05/31 09:17:21:208 CEST [DEBUG] content - << "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<TITLE>ERREUR : Accès au cache interdit</TITLE>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-se rif}PRE{font-family:sans-serif}--></STYLE>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</HEAD>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<BODY>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<H1>ERREUR</H1>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<H2>Accès au cache interdit</H2>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<HR noshade size="1px">[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<P>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "En essayant de charger l'URL :[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<A HREF="http://www.yahoo.fr/">http://www.yahoo.fr/</A>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<P>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "L'erreur suivante a été rencontrée :[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<UL>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<LI>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<STRONG>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "Accès au cache interdit.[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</STRONG>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</UL>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</P>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<P>Désolé, vous n'êtes actuellement pas autorisé[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "à demander[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<PRE> http://www.yahoo.fr/</PRE>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "à ce cache tant que vous ne vous êtes pas identifié.[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</P>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<P>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "Vous avez besoin de Netscape version 2.0 ou supérieure, ou Microsoft[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "Internet Explorer 3.0, ou un " 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "navigateur conforme à HTTP/1.1 pour que[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "ceci fonctionne. Veuillez contacter l'<A HREF="mailto:webmaster">administrateur du cache</a>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "si vous avez des difficultés à vous authentifier, ou[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<A HREF="http://ProxyA/cgi-bin/chpasswd.cgi">changez</a> votre mot de passe.[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</P>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<BR clear="all">[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<HR noshade size="1px">[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "<ADDRESS>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "Generated Tue, 31 May 2005 07:17:21 GMT by ProxyA (squid/2.5.STABLE9)[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</ADDRESS>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] content - << "</BODY></HTML>[\n]" 2005/05/31 09:17:21:224 CEST [DEBUG] HttpMethodBase - Should close connection in response to directive: close 2005/05/31 09:17:21:240 CEST [DEBUG] HttpConnection - Connection is locked. Call to releaseConnection() ignored. 2005/05/31 09:17:21:240 CEST [DEBUG] HttpMethodDirector - Authenticating with BASIC 'Squid proxy-caching web server'@192.168.10.225:8888 2005/05/31 09:17:21:240 CEST [DEBUG] HttpMethodParams - Credential charset not configured, using HTTP element charset 2005/05/31 09:17:21:240 CEST [DEBUG] HttpConnection - Open connection to 192.168.10.225:8888 2005/05/31 09:17:21:240 CEST [DEBUG] header - >> "GET http://www.yahoo.fr/ HTTP/1.0[\r][\n]" 2005/05/31 09:17:21:240 CEST [DEBUG] HttpMethodBase - Adding Host request header 2005/05/31 09:17:21:240 CEST [DEBUG] header - >> "User-Agent: Jakarta Commons-HttpClient/3.0-rc2[\r][\n]" 2005/05/31 09:17:21:240 CEST [DEBUG] header - >> "Proxy-Authorization: Basic ZnJhbmNvaXMubWV0ZW5pZXI6YmUyMDAz[\r][\n]" 2005/05/31 09:17:21:240 CEST [DEBUG] header - >> "Host: www.yahoo.fr[\r][\n]" 2005/05/31 09:17:21:240 CEST [DEBUG] header - >> "Proxy-Connection: Keep-Alive[\r][\n]" 2005/05/31 09:17:21:240 CEST [DEBUG] header - >> "[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "HTTP/1.0 407 Proxy Authentication Required[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Server: squid/2.5.STABLE9[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Mime-Version: 1.0[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Date: Tue, 31 May 2005 07:17:21 GMT[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Content-Type: text/html[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Content-Length: 1462[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Expires: Tue, 31 May 2005 07:17:21 GMT[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Proxy-Authenticate: NTLM[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Proxy-Authenticate: Basic realm="Squid proxy-caching web server"[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "X-Cache: MISS from ProxyA[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] header - << "Proxy-Connection: close[\r][\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] HttpMethodDirector - Authorization required 2005/05/31 09:17:21:255 CEST [DEBUG] AuthChallengeProcessor - Using authentication scheme: basic 2005/05/31 09:17:21:255 CEST [DEBUG] AuthChallengeProcessor - Authorization challenge processed 2005/05/31 09:17:21:255 CEST [DEBUG] HttpMethodDirector - Proxy authentication scope: BASIC 'Squid proxy-caching web server'@192.168.10.225:8888 2005/05/31 09:17:21:255 CEST [DEBUG] HttpMethodDirector - Proxy credentials required 2005/05/31 09:17:21:255 CEST [DEBUG] HttpMethodDirector - Proxy credentials provider not available 2005/05/31 09:17:21:255 CEST [INFO] HttpMethodDirector - Failure authenticating with BASIC 'Squid proxy-caching web server'@192.168.10.225:8888 2005/05/31 09:17:21:255 CEST [DEBUG] HttpMethodBase - Buffering response body 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<TITLE>ERREUR : Accès au cache interdit</TITLE>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-se rif}PRE{font-family:sans-serif}--></STYLE>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</HEAD>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<BODY>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<H1>ERREUR</H1>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<H2>Accès au cache interdit</H2>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<HR noshade size="1px">[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<P>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "En essayant de charger l'URL :[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<A HREF="http://www.yahoo.fr/">http://www.yahoo.fr/</A>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<P>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "L'erreur suivante a été rencontrée :[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<UL>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<LI>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<STRONG>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "Accès au cache interdit.[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</STRONG>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</UL>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</P>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<P>Désolé, vous n'êtes actuellement pas autorisé[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "à demander[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<PRE> http://www.yahoo.fr/</PRE>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "à ce cache tant que vous ne vous êtes pas identifié.[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</P>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<P>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "Vous avez besoin de Netscape version 2.0 ou supérieure, ou Microsoft[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "Internet Explorer 3.0, ou un navigateur conforme à HTTP/1.1 pour que[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "ceci fonctionne. Veuillez contacter l'<A HREF="mailto:webmaster">administrateur du cache</a>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "si vous avez des difficultés à vous authentifier, ou[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<A HREF="http://ProxyA/cgi-bin/chpasswd.cgi">changez</a> votre mot de passe.[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</P>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<BR clear="all">[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<HR noshade size="1px">[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "<ADDRESS>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "Generated Tue, 31 May 2005 07:17:21 GMT by ProxyA (squid/2.5.STABLE9)[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</ADDRESS>[\n]" 2005/05/31 09:17:21:255 CEST [DEBUG] content - << "</BODY></HTML>[\n]" 2005/05/31 09:17:21:271 CEST [DEBUG] HttpMethodBase - Should close connection in response to directive: close 2005/05/31 09:17:21:271 CEST [DEBUG] HttpConnection - Releasing connection back to connection manager. 2005/05/31 09:17:21:287 CEST [DEBUG] HttpMethodBase - Default charset used: ISO-8859-1 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
