mturk       2005/06/01 05:36:24

  Modified:    jni/java/org/apache/tomcat/jni SSLContext.java
               jni/native/src sslcontext.c
  Log:
  Add quiet shutdown option.
  
  Revision  Changes    Path
  1.8       +23 -2     
jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/SSLContext.java
  
  Index: SSLContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/SSLContext.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SSLContext.java   1 Jun 2005 12:08:29 -0000       1.7
  +++ SSLContext.java   1 Jun 2005 12:36:24 -0000       1.8
  @@ -94,7 +94,28 @@
        * Set OpenSSL Option.
        * @param ctx Server or Client context to use.
        * @param options  See SSL.SSL_OP_* for option flags.
  -     * @return true on success, false in case of error
        */
       public static native void setOptions(long ctx, int options);
  +
  +    /**
  +     * Sets the "quiet shutdown" flag for <b>ctx</b> to be
  +     * <b>mode</b>. SSL objects created from <b>ctx</b> inherit the
  +     * <b>mode</b> valid at the time and may be 0 or 1.
  +     * <br />
  +     * Normally when a SSL connection is finished, the parties must send out
  +     * "close notify" alert messages using L<SSL_shutdown(3)|SSL_shutdown(3)>
  +     * for a clean shutdown.
  +     * <br />
  +     * When setting the "quiet shutdown" flag to 1, <b>SSL.shutdown</b>
  +     * will set the internal flags to 
SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN.
  +     * (<b>SSL_shutdown</b> then behaves like called with
  +     * SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN.)
  +     * The session is thus considered to be shutdown, but no "close notify" 
alert
  +     * is sent to the peer. This behaviour violates the TLS standard.
  +     * The default is normal shutdown behaviour as described by the TLS 
standard.
  +     * @param ctx Server or Client context to use.
  +     * @param mode True to set the quiet shutdown.
  +     */
  +    public static native void setQuietShutdown(long ctx, boolean mode);
  +
   }
  
  
  
  1.13      +11 -1     jakarta-tomcat-connectors/jni/native/src/sslcontext.c
  
  Index: sslcontext.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/sslcontext.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- sslcontext.c      1 Jun 2005 12:16:50 -0000       1.12
  +++ sslcontext.c      1 Jun 2005 12:36:24 -0000       1.13
  @@ -269,6 +269,16 @@
       SSL_CTX_set_options(c->ctx, opt);
   }
   
  +TCN_IMPLEMENT_CALL(void, SSLContext, setQuietShutdown)(TCN_STDARGS, jlong 
ctx,
  +                                                       jboolean mode)
  +{
  +    tcn_ssl_ctxt_t *c = J2P(ctx, tcn_ssl_ctxt_t *);
  +
  +    UNREFERENCED_STDARGS;
  +    TCN_ASSERT(ctx != 0);
  +    SSL_CTX_set_quiet_shutdown(c->ctx, mode ? 1 : 0);
  +}
  +
   #else
   /* OpenSSL is not supported
    * If someday we make OpenSSL optional
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to