Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 16604 invoked from network); 5 Jul 2005 13:40:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jul 2005 13:40:36 -0000 Received: (qmail 75504 invoked by uid 500); 5 Jul 2005 13:40:35 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 75468 invoked by uid 500); 5 Jul 2005 13:40:34 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 75450 invoked by uid 99); 5 Jul 2005 13:40:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2005 06:40:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 213.46.255.21 is neither permitted nor denied by domain of segabor@gmail.com) Received: from [213.46.255.21] (HELO viefep18-int.chello.at) (213.46.255.21) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2005 06:40:34 -0700 Received: from [10.0.0.183] (really [80.98.109.238]) by viefep18-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20050705134027.EMYM12975.viefep18-int.chello.at@[10.0.0.183]> for ; Tue, 5 Jul 2005 15:40:27 +0200 Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?G=E1bor_SEBESTY=C9N?= Subject: Squid vs HttpClient Date: Tue, 5 Jul 2005 15:40:26 +0200 To: "HttpClient User Discussion" X-Mailer: Apple Mail (2.730) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Squid hates me. More precisely, I want to connect a squid proxy with =20 basic authentication and it refuses to accept me. The code: Map conf =3D (Map) Globals.getGlobals().get("proxy.current"); if (conf !=3D null) { String proxyHost =3D (String) conf.get("host"); int proxyPort =3D ((Integer) conf.get("port")).intValue(); String user =3D (String) conf.get("user"); String pwd =3D (String) conf.get("passwd"); client.getHostConfiguration().setProxy(proxyHost, =20 proxyPort); if (user !=3D null && pwd !=3D null) { client.getState().setProxyCredentials( new AuthScope(proxyHost, proxyPort, =20 org.apache.commons.httpclient.auth.AuthPolicy.BASIC), new UsernamePasswordCredentials(user, pwd)); } } The result: Java(TM) Plug-in: Version 1.4.2_07 Using JRE version 1.4.2_07 Java HotSpot(TM) Client VM ---------------------------------------------------- ... ---------------------------------------------------- ... Jul 5, 2005 3:34:05 PM =20 org.apache.commons.httpclient.auth.AuthChallengeProcessor =20 selectAuthScheme INFO: basic authentication scheme selected Jul 5, 2005 3:34:05 PM =20 org.apache.commons.httpclient.HttpMethodDirector =20 processProxyAuthChallenge INFO: No credentials available for BASIC 'Squid proxy-caching web =20 server'@core0:3128 Method failed: HTTP/1.0 407 Proxy Authentication Required java.lang.NullPointerException at com.netforum.talk2me.comm.CommController.login=20 (CommController.java:227) at com.netforum.talk2me.OperatorApplet.start(OperatorApplet.java:=20= 116) at sun.applet.AppletPanel.run(AppletPanel.java:391) at java.lang.Thread.run(Thread.java:552) java.lang.NullPointerException at com.netforum.talk2me.comm.CommController.login=20 (CommController.java:227) at com.netforum.talk2me.OperatorApplet.start(OperatorApplet.java:=20= 116) at sun.applet.AppletPanel.run(AppletPanel.java:391) at java.lang.Thread.run(Thread.java:552) That is, squid doesn't want to let me in. I doublechecked username / =20 password and it's correct. What's my fault? :D G=E1bor --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org