hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gábor SEBESTYÉN <sega...@gmail.com>
Subject Squid vs HttpClient
Date Tue, 05 Jul 2005 13:40:26 GMT
Squid hates me. More precisely, I want to connect a squid proxy with  
basic authentication and it refuses to accept me.
The code:

         Map conf = (Map) Globals.getGlobals().get("proxy.current");
         if (conf != null) {
             String proxyHost = (String) conf.get("host");
             int proxyPort = ((Integer) conf.get("port")).intValue();
             String user = (String) conf.get("user");
             String pwd = (String) conf.get("passwd");

             client.getHostConfiguration().setProxy(proxyHost,  
proxyPort);
             if (user != null && pwd != null) {
                 client.getState().setProxyCredentials(
                     new AuthScope(proxyHost, proxyPort,  
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  
org.apache.commons.httpclient.auth.AuthChallengeProcessor  
selectAuthScheme
INFO: basic authentication scheme selected
Jul 5, 2005 3:34:05 PM  
org.apache.commons.httpclient.HttpMethodDirector  
processProxyAuthChallenge
INFO: No credentials available for BASIC 'Squid proxy-caching web  
server'@core0:3128
Method failed: HTTP/1.0 407 Proxy Authentication Required
java.lang.NullPointerException
     at com.netforum.talk2me.comm.CommController.login 
(CommController.java:227)
     at com.netforum.talk2me.OperatorApplet.start(OperatorApplet.java: 
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 
(CommController.java:227)
     at com.netforum.talk2me.OperatorApplet.start(OperatorApplet.java: 
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 /  
password and it's correct.
What's my fault? :D

Gábor



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


Mime
View raw message