0 Replies Latest reply: Nov 25, 2013 10:06 AM by ahaubold RSS

    JAR Download intercepted by firewall via user-agent

    ahaubold

      Hi,

       

      Any suggestions on how to modify/set the user agent used by javaws ("JNLP/6.0 javaws/1.6.0_45 ...")? Is there a property for it? Reason below.

       

      I have experimented with starting a Java Webstart application from behind a corporate firewall. When I do so via a web browser, I receive the following error in a dialog:

      "Unable to launch the application"

      with detailed exception (full exception down below):

      "Server returned HTTP response code: 403 for URL: http://MY_SERVER/MY_JNLP

       

      This exception is thrown at the time of downloading the JAR. The URL is fine; the server serving the JAR works fine, too; file is publicly available. No reason for a 403 (forbidden). Works fine outside the corporate firewall. On the command line, the following works:

      wget http://URL_OF_JNLP

      wget http://URL_OF_JAR

       

      I understand that a typical download request from Java Webstart has the following signature (Apache logs):

      CLIENT_ADDR- - [25/Nov/2013:10:25:42 -0500] "GET /MY_JNLP HTTP/1.1" 200 1182 "MY_URL" "Mozilla/5.0 (X11; SunOS sun4u; rv:24.0) Gecko/20100101 Firefox/24.0"

      CLIENT_ADDR - - [25/Nov/2013:10:25:53 -0500] "GET /MY_JAR HTTP/1.1" 200 716279 "-" "JNLP/6.0 javaws/1.6.0_45 (b06) Java/1.6.0_45"

       

      When I replace the user agent for wget's otherwise successful GET with Java Webstart's:

      wget --user-agent="JNLP/6.0 javaws/1.6.0_45 (b06) Java/1.6.0_45" http://URL_OF_JAR

       

      I receive the same 403 found when starting Java Webstart:

      Resolving DOMAINNAME... IP_ADDR

      Connecting to DOMAINNAME|IP_ADDR|:80... connected.

      HTTP request sent, awaiting response... 403 Forbidden

      2013-11-25 10:27:15 ERROR 403: Forbidden.

       

      Evidently, the corporate firewall blocks GET requests with user agent set to javaws-related user agents. Any suggestions on how to tackle this problem? Any way to set the user agent in the wget-style? Or set up a simple local proxy that masks the user agent and handles GET requests for JARs, etc.?

       

      Thanks for your help.

       

      Alex

       

       

       

       

      Detailed exception:

       

      java.io.IOException: Server returned HTTP response code: 403 for URL: http://MY_SERVER/MY_JNLP

          at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown Source)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

          at java.lang.reflect.Constructor.newInstance(Unknown Source)

          at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)

          at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)

          at java.security.AccessController.doPrivileged(Native Method)

          at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)

          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

          at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)

          at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)

          at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)

          at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)

          at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)

          at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)

          at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)

          at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)

          at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)

          at com.sun.javaws.Launcher.launch(Unknown Source)

          at com.sun.javaws.Main.launchApp(Unknown Source)

          at com.sun.javaws.Main.continueInSecureThread(Unknown Source)

          at com.sun.javaws.Main.access$000(Unknown Source)

          at com.sun.javaws.Main$1.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

      Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://MY_SERVER/MY_JNLP

          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

          at java.net.HttpURLConnection.getResponseCode(Unknown Source)

          ... 15 more