JDK-6504564 : Web Start uses Firefox proxy settings even when disabled
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-12-14
  • Updated: 2011-02-16
  • Resolved: 2006-12-19
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
Java Web start tries to follow Firefox's proxy settings even if Firefox is configured to directly connect to the internet.  This happens if the user has previously had a proxy setting for Firefox, but since changed Firefox to direct connection.  The proxy settings are still in the firefox prefs.js, but network.proxy.type is not present, indicating a direct connection.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Have a java web start app that performs socket operations.  The jnlp file should set   <security><all-permissions /></security>.
Have Firefox be the default browser.
In Firefox, Tools -> Options, Advanced, Connection/Settings..., Select Manual Proxy Configuration and fill in a bogus host and port for all fields.  Click OK. Click OK again.
In Firefox, Tools -> Options, Advanced, Connection/Settings..., Select Direct Connection to the Internet.  Click OK. Click OK again.

Configre Java Web start "Network Proxy Settings" to "Use Browser Settings".
Now start your webstart application.  When the application attempts to connect a Socket, a ~1 minute pause will be followed by an exception.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Socket should connect directly to the host/port specified in the program.
ACTUAL -
Socket attempts to use old Firefox proxy information.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exceptions seen from Socket.connect:

java.net.SocketException: Software caused connection abort: recv failed
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(Unknown Source)
	at java.net.SocksSocketImpl.readSocksReply(Unknown Source)
	at java.net.SocksSocketImpl.connectV4(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)

or:
java.net.SocketException: Reply from SOCKS server has bad version
	at java.net.SocksSocketImpl.connectV4(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.text.*;
import java.util.*;
import java.util.logging.*;


class TestSocket
{
    static final Logger log = Logger.getLogger(TestSocket.class.getName());

    public static void main( String[] args )
    {
        try
        {
            Handler fh = new FileHandler("TestSocket.log");
            fh.setFormatter(new SimpleFormatter());
            log.addHandler(fh);

            Socket socket = new Socket("www.google.com", 80);
            PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
            BufferedReader in = new BufferedReader(new InputStreamReader( socket.getInputStream()));

            out.println("GET index.html HTTP/1.1/\n");

            String line;
            while ((line = in.readLine()) != null )
                log.severe(line);
        }
        catch (UnknownHostException e) { log.log(Level.SEVERE, "error", e); }
        catch (IOException e) { log.log(Level.SEVERE, "error", e); }
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
In Firefox, Tools -> Options, Advanced, Connection/Settings..., Select Manual Proxy Configuration and clear host and port for all fields.  Click OK. Click OK again.
In Firefox, Tools -> Options, Advanced, Connection/Settings..., Select Direct Connection to the Internet.  Click OK. Click OK again.

Comments
EVALUATION This is the same issue as bug 6484949, which has been fixed in Dolphin and JDK 6.0u1.
19-12-2006