United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4725999 Other socks proxy cannot be dynamically used once default socks proxy settings a
JDK-4725999 : Other socks proxy cannot be dynamically used once default socks proxy settings a

Details
Type:
Bug
Submit Date:
2002-08-05
Status:
Resolved
Updated Date:
2002-11-19
Project Name:
JDK
Resolved Date:
2002-11-19
Component:
core-libs
OS:
windows_2000
Sub-Component:
java.net
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.1
Fixed Versions:
1.4.2 (mantis)

Related Reports

Sub Tasks

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
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
                                     
2002-08-05
WORK AROUND



Name: dk106046			Date: 08/05/2002

None
======================================================================
                                     
2004-06-11
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis
mantis-b08


                                     
2004-06-14



Hardware and Software, Engineered to Work Together