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

Inconsistent SSLSessionContext.setSessionTimeout() behavior

    Details

      Description



      Name: aiR10266 Date: 06/28/2004


      The setSessionTimeout(int seconds) method of default SSLSessionContext
      interface implementation sets negative timeout if parameter is a huge
      value such as Integer.MAX_VALUE.

      Example:

      ------------------TimeoutTest.java----------------
      import javax.net.ssl.*;

      public class TimeoutTest {
          public static void main(String argv[]) throws Exception {
              SSLContext sslc = SSLContext.getInstance("SSLv3", "SunJSSE");
              SSLSessionContext cnt = sslc.getServerSessionContext();
              cnt.setSessionTimeout(Integer.MAX_VALUE);
              System.out.println("Expected seconds: " + Integer.MAX_VALUE +
                 ", got seconds: " + cnt.getSessionTimeout());
          }
      }
      -------------------OUTPUT--------------------
      Expected seconds: 2147483647, got seconds: -1

      % java -version
      java version "1.4.2_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
      Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andreas Andreas Sterbenz
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: