0

My Java application runs through Java web start and I'm downloading a file from a web server using browser's session ID. It works fine on previous to Java 7 update 51 but failed on Java 7 update 51. Here is the code. There is no issue on HTTP URL. Problem only occurs with HTTPSURL.

When Java application makes connection with the HTTPS URL, web server not considering URL as a valid URL.

     URL webURL = new URL(m_url);
     conn = webURL.openConnection();
     conn.setRequestProperty("Cookie", cookie);

Cookie has valid session ID. Again this works fine on Prior to Java 7 update 51.

Anything has changed on Java 7 update 51 related to HTTPS URL Connection?

It seems to be Java Web start sends empty HTTPS request before sending actual HTTPS request. Again this happens only after Java 7 update 51.

Joe
  • 365
  • 2
  • 9
  • 24
  • It's probably not the same issue, but at one point I had a similar problem - a connection would work with one JDK but not another. The issue was somehow caused by the default HTTP handler. Maybe try creating the URL and specifying a handler? Something like this `URL url = new URL(null,m_url, new sun.net.www.protocol.http.Handler()); ` – DHall May 28 '14 at 14:08

1 Answers1

0

Root cause for empty HTTPS request is below line of JNLP code.

**<jnlp codebase="https://20.107.21.23:443" spec="1.0+">**

Found solution in two ways.

  1. Changes in web server code When web server receives empty HTTPS request, do not set cookie for that request.

  2. Change codebase attribute value in JNLP file as below

    **<jnlp codebase="https://*20.107.21.23:443" spec="1.0+">**
    

    or

    **<jnlp codebase="https://20.107.21.23:443/*" spec="1.0+">** 
    
Joe
  • 365
  • 2
  • 9
  • 24