[jboss-cvs] JBossAS SVN: r61011 - in branches/Branch_4_0/tomcat/src/main/org/jboss: web/tomcat/security and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 28 13:37:23 EST 2007


Author: anil.saldhana at jboss.com
Date: 2007-02-28 13:37:22 -0500 (Wed, 28 Feb 2007)
New Revision: 61011

Modified:
   branches/Branch_4_0/tomcat/src/main/org/jboss/net/ssl/JBossSocketFactory.java
   branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/security/GenericHeaderAuthenticator.java
Log:
check if the configuration for http head ers and session cookies are present

Modified: branches/Branch_4_0/tomcat/src/main/org/jboss/net/ssl/JBossSocketFactory.java
===================================================================
--- branches/Branch_4_0/tomcat/src/main/org/jboss/net/ssl/JBossSocketFactory.java	2007-02-28 18:35:46 UTC (rev 61010)
+++ branches/Branch_4_0/tomcat/src/main/org/jboss/net/ssl/JBossSocketFactory.java	2007-02-28 18:37:22 UTC (rev 61011)
@@ -21,7 +21,7 @@
  */
 package org.jboss.net.ssl;
 
-import java.io.IOException;
+import java.io.IOException; 
 import java.security.KeyStore;
 
 import javax.naming.InitialContext;
@@ -31,6 +31,7 @@
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.KeyManagerFactory;
 
+import org.jboss.logging.Logger;
 import org.jboss.security.SecurityDomain;
 import org.apache.tomcat.util.net.jsse.JSSE14SocketFactory;
 
@@ -43,6 +44,8 @@
 public class JBossSocketFactory
    extends JSSE14SocketFactory
 {
+   protected Logger thisLog = Logger.getLogger(JBossSocketFactory.class);
+   
    private SecurityDomain securityDomain;
 
    public JBossSocketFactory()
@@ -152,14 +155,33 @@
          keyMgrs = kmf.getKeyManagers();
       }
       return keyMgrs;
-   }
+   } 
+   
+   /**
+    * Override to log the final enabled ciphers
+    */
+   protected String[] getEnabledCiphers(String requestedCiphers,
+                                           String[] supportedCiphers)
+   { 
+      String[] baseCiphers =  super.getEnabledCiphers(requestedCiphers, supportedCiphers);
+      if(thisLog.isTraceEnabled())
+      {
+         //Print them out
+         int len = baseCiphers != null ? baseCiphers.length: 0; 
+         for(int i = 0; i < len; i++)
+         {
+            thisLog.trace("Enabled Cipher:["+i+"]=" + baseCiphers[i]);
+         }
+      } 
+      return baseCiphers;
+   } 
 
-    private void verifySecurityDomain()
-    {
+   private void verifySecurityDomain()
+   {
       String str = "securityDomain is null." +
             "Set it as an attribute in the connector setting";
       
       if(this.securityDomain == null)
           throw new IllegalStateException(str);
-    }
+   }
 }

Modified: branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/security/GenericHeaderAuthenticator.java
===================================================================
--- branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/security/GenericHeaderAuthenticator.java	2007-02-28 18:35:46 UTC (rev 61010)
+++ branches/Branch_4_0/tomcat/src/main/org/jboss/web/tomcat/security/GenericHeaderAuthenticator.java	2007-02-28 18:37:22 UTC (rev 61011)
@@ -120,6 +120,9 @@
          if(trace)
             log.trace("getUserId exception", e);
       }
+      if(ids == null || ids.length() == 0)
+         throw new IllegalStateException("Http headers configuration in tomcat service missing");
+      
       StringTokenizer st = new StringTokenizer(ids,",");
       while(st.hasMoreTokens())
       {
@@ -155,6 +158,9 @@
          if(trace)
             log.trace("checkSessionCookie exception", e);
       }
+      if(ids == null || ids.length() == 0)
+         throw new IllegalStateException("Session cookies configuration in tomcat service missing");
+      
       StringTokenizer st = new StringTokenizer(ids,",");
       while(st.hasMoreTokens())
       { 




More information about the jboss-cvs-commits mailing list