Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6356776

Incorrect http1.1 CONNECT message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      WINDOWS XP, WINDOWS 2000

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      The plug-in sends content-length in the CONNECT message.

      A DESCRIPTION OF THE PROBLEM :
      If one sets the content-length in the the java code as follws:
      conn.setRequestProperty("content-length", "" + toSendData.length());

      The CONNECT message that is sent to the proxy contains the content-length field with the corresponding length. A CONNECT message should have content-length 0. It is in the next POST message that the content-length of the data should be placed. Some proxy server are very picky about this and refuses to set up a connection. If we do not set the content-length explicitly in the code it works fine. A fix would be to set content-length 0 in a CONNECT message.

      The error is in jre 1.4 and jre 1.5

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      We use Tren Micro IWSS inhouse and this one refuses to set up a connection.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      conn.setRequestProperty("content-type", "application/x-www-form-urlencoded; charset=iso-8859-1");
      conn.setRequestProperty("content-length", "" + toSendData.length());


      out = new BufferedOutputStream(conn.getOutputStream());
      out.write(toSendData.getBytes("ISO-8859-1"));
      out.flush();
      out.close();
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      if we do not set content-length explicitly it works.

            chegar Chris Hegarty
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: