directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r188663 - in /directory/network: branches/0.7/src/java/org/apache/mina/io/filter/SSLFilter.java branches/0.7/src/java/org/apache/mina/io/filter/SSLHandler.java trunk/src/java/org/apache/mina/filter/SSLFilter.java trunk/src/java/org/apache/mina/filter/SSLHandler.java
Date Tue, 07 Jun 2005 01:52:03 GMT
Author: trustin
Date: Mon Jun  6 18:52:02 2005
New Revision: 188663

URL: http://svn.apache.org/viewcvs?rev=188663&view=rev
Log:
Fixed: DIRMINA-48 and DIRMINA-50


Modified:
    directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLFilter.java
    directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLHandler.java
    directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java
    directory/network/trunk/src/java/org/apache/mina/filter/SSLHandler.java

Modified: directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLFilter.java?rev=188663&r1=188662&r2=188663&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLFilter.java (original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLFilter.java Mon Jun
 6 18:52:02 2005
@@ -46,6 +46,12 @@
  */
 public class SSLFilter extends IoFilterAdapter
 {
+    /**
+     * Session attribute key that stores underlying {@link javax.net.ssl.SSLSession}
+     * for each session.
+     */
+    public static final String SSL_SESSION = SSLFilter.class.getName() + ".SSLSession";
+
     private static final Logger log = Logger.getLogger( SSLFilter.class.getName() );
 
     /**

Modified: directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLHandler.java?rev=188663&r1=188662&r2=188663&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLHandler.java (original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/io/filter/SSLHandler.java Mon
Jun  6 18:52:02 2005
@@ -111,8 +111,16 @@
         this.session = session;
         sslEngine = sslc.createSSLEngine();
         sslEngine.setUseClientMode( parent.isUseClientMode() );
-        sslEngine.setNeedClientAuth( parent.isNeedClientAuth() );
-        sslEngine.setWantClientAuth( parent.isWantClientAuth() );
+
+        if ( parent.isWantClientAuth() )
+        {
+            sslEngine.setWantClientAuth( true );
+        }
+
+        if ( parent.isNeedClientAuth() )
+        {
+            sslEngine.setNeedClientAuth( true );
+        }
   
         if( parent.getEnabledCipherSuites() != null )
         {
@@ -127,7 +135,6 @@
         sslEngine.beginHandshake();   
         initialHandshakeStatus = sslEngine.getHandshakeStatus();//SSLEngineResult.HandshakeStatus.NEED_UNWRAP;
         initialHandshakeComplete = false;
-        //SSLSession sslSession = sslEngine.getSession
         
         SSLByteBufferPool.initiate( sslEngine );
 
@@ -415,11 +422,12 @@
         {
             if( initialHandshakeStatus == SSLEngineResult.HandshakeStatus.FINISHED )
             {
+                session.setAttribute( SSLFilter.SSL_SESSION, sslEngine.getSession() );
                 if( log.isLoggable( Level.FINEST ) )
                 {
                     SSLSession sslSession = sslEngine.getSession();
                     log.log( Level.FINEST, session + "  initialHandshakeStatus=FINISHED"
);
-                    log.log( Level.FINEST, session + "  sslSession CipherSuite used " + sslSession.getCipherSuite());
+                    log.log( Level.FINEST, session + "  sslSession CipherSuite used " + sslSession.getCipherSuite()
);
                 }
                 initialHandshakeComplete = true;
                 return;

Modified: directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java?rev=188663&r1=188662&r2=188663&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java Mon Jun  6 18:52:02
2005
@@ -46,6 +46,12 @@
  */
 public class SSLFilter extends IoFilterAdapter
 {
+    /**
+     * Session attribute key that stores underlying {@link javax.net.ssl.SSLSession}
+     * for each session.
+     */
+    public static final String SSL_SESSION = SSLFilter.class.getName() + ".SSLSession";
+
     private static final Logger log = Logger.getLogger( SSLFilter.class.getName() );
 
     // SSL Context

Modified: directory/network/trunk/src/java/org/apache/mina/filter/SSLHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/SSLHandler.java?rev=188663&r1=188662&r2=188663&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/SSLHandler.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/SSLHandler.java Mon Jun  6 18:52:02
2005
@@ -109,8 +109,16 @@
         this.session = session;
         sslEngine = sslc.createSSLEngine();
         sslEngine.setUseClientMode( parent.isUseClientMode() );
-        sslEngine.setNeedClientAuth( parent.isNeedClientAuth() );
-        sslEngine.setWantClientAuth( parent.isWantClientAuth() );
+
+        if ( parent.isWantClientAuth() )
+        {
+            sslEngine.setWantClientAuth( true );
+        }
+
+        if ( parent.isNeedClientAuth() )
+        {
+            sslEngine.setNeedClientAuth( true );
+        }
   
         if( parent.getEnabledCipherSuites() != null )
         {
@@ -125,7 +133,6 @@
         sslEngine.beginHandshake();   
         initialHandshakeStatus = sslEngine.getHandshakeStatus();//SSLEngineResult.HandshakeStatus.NEED_UNWRAP;
         initialHandshakeComplete = false;
-        //SSLSession sslSession = sslEngine.getSession
         
         SSLByteBufferPool.initiate( sslEngine );
 
@@ -410,11 +417,12 @@
         {
             if( initialHandshakeStatus == SSLEngineResult.HandshakeStatus.FINISHED )
             {
+                session.setAttribute( SSLFilter.SSL_SESSION, sslEngine.getSession() );
                 if( log.isLoggable( Level.FINEST ) )
                 {
                     SSLSession sslSession = sslEngine.getSession();
                     log.log( Level.FINEST, session + "  initialHandshakeStatus=FINISHED"
);
-                    log.log( Level.FINEST, session + "  sslSession CipherSuite used " + sslSession.getCipherSuite());
+                    log.log( Level.FINEST, session + "  sslSession CipherSuite used " + sslSession.getCipherSuite()
);
                 }
                 initialHandshakeComplete = true;
                 return;



Mime
View raw message