hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Proxy authentication details fetching
Date Tue, 11 Sep 2007 15:50:12 GMT
On Tue, 2007-09-11 at 06:50 -0700, DreamEfforts wrote:
> Thank you very much for replying to my query.
> 
> I didn't set any property to the System and I tested with the by below
> properties, but still it's not working.
> System.clearProperty("socksProxyHost");
> System.clearProperty("socksProxyPort");
> 
> If I run the socks server and if I set the below the properties then it is
> working fine,
>
>  but I cannot assume that who ever is accessing my application
> should run the socks server in their system.
> 
> System.setProperty("socksProxyHost", hostName);
> System.setProperty("socksProxyPort", "" + 8085);
> 
> Thanks
> 

>> server>java.net.SocketException: Malformed reply from SOCKS server
> >> 	at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
> >> 	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)

It is obvious for some reason the JRE tries to talk SOCKS protocol to a
host, which is not a SOCKS proxy or does not support the same protocol
version. I can only assume the system property gets assigned
programmatically by some third party library or inside your code by
mistake.

Oleg  


> 
> 
> olegk wrote:
> > 
> > On Mon, 2007-09-10 at 10:39 -0700, DreamEfforts wrote:
> > 
> > ...
> > 
> >> When using the same code in a bean class then it’s not working and it’s
> >> throwing the exception. I could understand that apache proxy client is
> >> trying to connect to the Socks server, but socks server details are not
> >> present in the system properties. 
> >> 
> >> 2007/09/05 11:32:24:041 EDT [DEBUG] HttpConnection - Open connection to
> >> 192.158.10.151:80
> >> 2007/09/05 11:37:24:553 EDT [DEBUG] HttpMethodDirector - Closing the
> >> connection.
> >> 2007/09/05 11:37:24:553 EDT [INFO] HttpMethodDirector - I/O exception
> >> (java.net.SocketException) caught when processing request: Malformed
> >> reply
> >> from SOCKS server
> >> 2007/09/05 11:37:24:553 EDT [DEBUG] HttpMethodDirector - Malformed reply
> >> from SOCKS server <java.net.SocketException: Malformed reply from SOCKS
> >> server>java.net.SocketException: Malformed reply from SOCKS server
> >> 	at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
> >> 	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
> >> 	at java.net.Socket.connect(Socket.java:519)
> >> 	at java.net.Socket.connect(Socket.java:469)
> >> 	at java.net.Socket.<init>(Socket.java:366)
> >> 	at java.net.Socket.<init>(Socket.java:239)
> > 
> > As you can see, the exception is thrown inside the system
> > SocksSocketImpl class. So, apparently socksProxyHost system property has
> > been set, thus causing every outgoing TCP socket to connect to the
> > remote server though the specified host using SOCKS protocol.
> > 
> > Oleg
> > 
> >> 
> >> Can any one help me how to fix this issue.
> >> 
> >> Thanks
> >> 
> >> 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> > 
> > 
> > 
> 


---------------------------------------------------------------------
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