JDK-4725999 : Other socks proxy cannot be dynamically used once default socks proxy settings a
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-08-05
  • Updated: 2002-11-19
  • Resolved: 2002-11-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 mantisFixed
Description

Name: dk106046			Date: 08/05/2002

Windows XP- v5.1.2600 

JDK 1.4.0-b92 and 1.4.1.

Problem Description:
In the 1.4 JDK, once one socket is opened when the default socks proxy settings are in effect, we can no longer dynamically take over control of an another socks proxy.  

Even though we are opening a socket to natchez.raleigh.ibm.com (since we changed the socksProxyHost system property) the socket was actually getting opened on socks.raleigh.ibm.com (which is the default proxy). 

This can  viewed using the utility, tcpview, which can be downloaded from www.sysinternals.com, to monitor open sockets, and too show the process owner of the socket host. 

1. In the failing scenerio, tcpview will show you a socket open to socks server socks.raleigh.ibm.com (usually redirects open-a-socket requests to a different socks server usually with a name like ss07.raleigh.ibm.com - the '07 can be any number') 

2. In the passing scenerio, tcpview will only show a socket open to natchez.raleigh.ibm.com with no socket opened to ss??.raleigh.ibm.com. 

Exact steps to reproduce:

Note the socks server names are internal to us, and are only provided as examples.  The source code is available on request.

For the failing Scenario:
1.Compile the files SocksSocket.java and sockstest.java
2.Change the browser setting to use socks.raleigh.ibm.com
3.Run tcpview by double clicking on the tcpview.exe
4. Run sockstest.html using Internet Explorer.
5. Open the tcpview window to observe that for iexplore.exe process,remote address is  ss??.raleigh.ibm.com (the one set in the browser) instead of natchez.raleigh.ibm.com.

For the Passing Scenario:
1. Comment the following code in the file sockstest.java
try
      {
        System.out.println("creating socket to "+otherHostStr);
        otherHost = InetAddress.getByName(otherHostStr);
        otherHostSocket = create_Other_Socket(otherHost);
      }
      catch (Exception e)
      {
        System.out.println("exception occured while opening socket to 'other' host");
      }
        
Then follow the steps as given for the failing scenario. Here the tcpview window shows that for the iexplore.exe process, remote Address was natchez.raleigh.ibm.com. This is the excepted output. 

NB: The problem is not recreatable with Netscape/JDK 1.4.  Neither is the problem recreatable with either browser using JDK 1.3.1.

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b08
14-06-2004

WORK AROUND Name: dk106046 Date: 08/05/2002 None ======================================================================
11-06-2004

EVALUATION Yes, the socksProxyHost/sosksProxyPort properties are only examined in Socket's static initializer so subsequent changes to the properties are ignored. For mantis we should evaluate if restoring the dynamic settings is appropriate but the right solution is a socket factory framework so that we can create and co-exist proxied & non-proxied sockets. The latter is appropriate for tiger. ###@###.### 2002-08-05
05-08-2002