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

Remove IllegalStateException SSLSocket.startHandshake/SSLEngine.beginHandshake

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • security-libs
    • b36
    • sparc
    • solaris_2.6
    • Verified



      Name: ktR10099 Date: 12/16/2003



      According to the spec for javax.net.ssl.SSLSocket.startHandshake() it
      should throw "...IllegalStateException - if attempted to handshake on a
      closed socket". Please find below example, demostarting that
      SocketException is thrown instead.
      -----------------------------test143.java------------------------
      import javax.net.ssl.*;

      public class test143 {
          public static void main(String[] args) {
              SSLSocket s = null;
              try {
                  SSLSocketFactory sf = (SSLSocketFactory)SSLSocketFactory.getDefault();
                  s = (SSLSocket)sf.createSocket();
              } catch (Exception e) {
                  System.out.println(e);
              }
              try {
                  s.startHandshake();
              } catch (Exception e) {
                  System.out.println(e);
              }
              System.out.println("Finished");
          }
      }
      -------------------------output of test143---------------------------
      java full version "1.5.0-beta-b31"
      java.net.SocketException: Socket is not connected
      Finished
      ---------------------------------------------------------------------
      ======================================================================

            wetmore Bradford Wetmore
            kvtsunw Kvt Kvt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: