directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r944871 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Date Sun, 16 May 2010 15:59:13 GMT
Author: seelmann
Date: Sun May 16 15:59:13 2010
New Revision: 944871

URL: http://svn.apache.org/viewvc?rev=944871&view=rev
Log:
Fixed reload of SSL certificates in case multiple transports are configured. Caused sporadic
failure of LdapsUpdateCertificateIT.

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=944871&r1=944870&r2=944871&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Sun May 16 15:59:13 2010
@@ -223,7 +223,7 @@ public class LdapServer extends Director
 
     private KeyStore keyStore = null;
 
-    private IoFilterChainBuilder chainBuilder;
+    private List<IoFilterChainBuilder> chainBuilders = new ArrayList<IoFilterChainBuilder>();
     
     private ReplicationProvider replicationProvider;
     
@@ -379,16 +379,20 @@ public class LdapServer extends Director
         }
 
         LOG.info( "reloading SSL context..." );
-        
+
         loadKeyStore();
-        
-        DefaultIoFilterChainBuilder dfcb = ( ( DefaultIoFilterChainBuilder ) chainBuilder
);
+
         String sslFilterName = "sslFilter";
-        if( dfcb.contains( sslFilterName ) )
+        for ( IoFilterChainBuilder chainBuilder : chainBuilders )
         {
-            DefaultIoFilterChainBuilder newChain = ( DefaultIoFilterChainBuilder ) LdapsInitializer.init(
keyStore, certificatePassword );
-            dfcb.replace( sslFilterName, newChain.get( sslFilterName ) );
-            newChain = null;
+            DefaultIoFilterChainBuilder dfcb = ( ( DefaultIoFilterChainBuilder ) chainBuilder
);
+            if ( dfcb.contains( sslFilterName ) )
+            {
+                DefaultIoFilterChainBuilder newChain = ( DefaultIoFilterChainBuilder ) LdapsInitializer.init(
keyStore,
+                    certificatePassword );
+                dfcb.replace( sslFilterName, newChain.get( sslFilterName ) );
+                newChain = null;
+            }
         }
 
         StartTlsHandler handler = ( StartTlsHandler ) getExtendedOperationHandler( StartTlsHandler.EXTENSION_OID
);
@@ -399,7 +403,7 @@ public class LdapServer extends Director
             // both in the LdapService as well as StatTlsHandler
             handler.setLdapServer( this );
         }
-        
+
         LOG.info( "reloaded SSL context successfully" );
     }
 
@@ -557,9 +561,9 @@ public class LdapServer extends Director
             // Set the backlog to the default value when it's below 0
             transport.setBackLog( 50 );
         }
-        
-        this.chainBuilder = chainBuilder;
-        
+
+        chainBuilders.add( chainBuilder );
+
         PartitionNexus nexus = getDirectoryService().getPartitionNexus();
 
         for ( ExtendedOperationHandler h : extendedOperationHandlers )



Mime
View raw message