tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup ContextConfig.java
Date Sun, 12 May 2002 04:04:27 GMT
glenn       02/05/11 21:04:27

  Modified:    catalina/src/share/org/apache/catalina/startup
                        ContextConfig.java
  Log:
  Only add the CertificatesValve if this Context is using a Connector
  where secure=true.  Slight performance improvement for non SSL Hosts.
  
  Revision  Changes    Path
  1.63      +35 -7     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- ContextConfig.java	22 Apr 2002 19:04:01 -0000	1.62
  +++ ContextConfig.java	12 May 2002 04:04:27 -0000	1.63
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
1.62 2002/04/22 19:04:01 craigmcc Exp $
  - * $Revision: 1.62 $
  - * $Date: 2002/04/22 19:04:01 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
1.63 2002/05/12 04:04:27 glenn Exp $
  + * $Revision: 1.63 $
  + * $Date: 2002/05/12 04:04:27 $
    *
    * ====================================================================
    *
  @@ -92,21 +92,22 @@
   import javax.servlet.ServletContext;
   import javax.servlet.ServletException;
   import org.apache.catalina.Authenticator;
  +import org.apache.catalina.Connector;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
   import org.apache.catalina.DefaultContext;
  +import org.apache.catalina.Engine;
   import org.apache.catalina.Globals;
  +import org.apache.catalina.Host;
   import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleEvent;
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Pipeline;
  +import org.apache.catalina.Service;
   import org.apache.catalina.Valve;
   import org.apache.catalina.Wrapper;
   import org.apache.catalina.core.ContainerBase;
  -import org.apache.catalina.Engine;
  -import org.apache.catalina.Host;
  -import org.apache.catalina.core.ContainerBase;
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.deploy.ApplicationParameter;
   import org.apache.catalina.deploy.ContextEjb;
  @@ -132,7 +133,7 @@
    * of that Context, and the associated defined servlets.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.62 $ $Date: 2002/04/22 19:04:01 $
  + * @version $Revision: 1.63 $ $Date: 2002/05/12 04:04:27 $
    */
   
   public final class ContextConfig
  @@ -397,9 +398,36 @@
        * Create and deploy a Valve to expose the SSL certificates presented
        * by this client, if any.  If we cannot instantiate such a Valve
        * (because the JSSE classes are not available), silently continue.
  +     * This is only instantiated for those Contexts being served by
  +     * a Connector with secure set to true.
        */
       private void certificatesConfig() {
   
  +        // Only install this valve if there is a Connector installed
  +        // which has secure set to true.
  +        boolean secure = false;
  +        Container container = context.getParent();
  +        if (container instanceof Host) {
  +            System.out.println("certificatesConfig found Host");
  +            container = container.getParent();
  +        }
  +        if (container instanceof Engine) {
  +            System.out.println("certificatesConfig found Engine");
  +            Service service = ((Engine)container).getService();
  +            Connector [] connectors = service.findConnectors();
  +            for (int i = 0; i < connectors.length; i++) {
  +                System.out.println("certificatesConfig found Connector");
  +                secure = connectors[i].getSecure();
  +                if (secure) {
  +                    break;
  +                }
  +            }
  +        }
  +
  +        if (!secure) {
  +            return;
  +        }
  +        System.out.println("certificatesConfig add CertificatesValve");
           // Validate that the JSSE classes are present
           try {
               Class clazz = this.getClass().getClassLoader().loadClass
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message