Name: boT120536 Date: 06/03/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
The java.net.SocksSocketImpl.java file sends USER_PASSW as a supported
authorization type, but then does not do a UserName/Password handshake if the
SOCKS 5 server responds with that auth. type.
Also, since 1.4 supports Kerberos 5 and GSS-API, you should also be sending
GSSAPI as a supported auth type as well. I admit adding this may be non-
trivial, and most SOCKS 5 clients and servers only support NONE or
USER/PASSWORD as auth. types. But, at least really support USER/PASSWORD since
your SOCKS 5 request says you do.
The connectv4() method in SocksSocketImpl also expects a 0 back as the first
byte of the response, which is according to the spec, but some SOCKS 4 servers
respond with a 4 as the first byte. This would be a very simple "or" check.
Lastly, shouldn't we have 2 new properties, socks4proxyHost, and
socks5ProxyPort, instead of using the existing socksProxyHost and
socksProxyPort properties for both SOCKS 4 and 5, then then attempting to guess
which one we are connecting to, as SocksSocketImplFactor.guessVersion() does.
This would also be a very simple code change.
(Review ID: 125444)
======================================================================
- duplicates
-
JDK-4468877 Support authentication with SOCKSv5
-
- Closed
-