You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/07/17 13:02:40 UTC

svn commit: r795039 - in /tomcat/container/tc5.5.x: catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java webapps/docs/apr.xml webapps/docs/changelog.xml

Author: markt
Date: Fri Jul 17 11:02:40 2009
New Revision: 795039

URL: http://svn.apache.org/viewvc?rev=795039&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39997
Port of http://svn.apache.org/viewvc?view=rev&revision=637867
Add SSLRandomSeed option to APR to enable faster starts on development systems

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java
    tomcat/container/tc5.5.x/webapps/docs/apr.xml
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java?rev=795039&r1=795038&r2=795039&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java (original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java Fri Jul 17 11:02:40 2009
@@ -47,6 +47,7 @@
     protected StringManager sm =
         StringManager.getManager(Constants.Package);
 
+    protected static String SSLRandomSeed = "builtin";
     
     // -------------------------------------------------------------- Constants
 
@@ -80,6 +81,13 @@
                 Class clazz = Class.forName("org.apache.tomcat.jni.Library");
                 Method method = clazz.getMethod(methodName, paramTypes);
                 method.invoke(null, paramValues);
+                
+                methodName = "randSet";
+                paramValues[0] = SSLRandomSeed;
+                clazz = Class.forName("org.apache.tomcat.jni.SSL");
+                method = clazz.getMethod(methodName, paramTypes);
+                method.invoke(null, paramValues);
+
                 major = clazz.getField("TCN_MAJOR_VERSION").getInt(null);
                 minor = clazz.getField("TCN_MINOR_VERSION").getInt(null);
                 patch = clazz.getField("TCN_PATCH_VERSION").getInt(null);
@@ -131,5 +139,11 @@
 
     }
 
+    public String getSSLRandomSeed() {
+        return SSLRandomSeed;
+    }
 
+    public void setSSLRandomSeed(String SSLRandomSeed) {
+        AprLifecycleListener.SSLRandomSeed = SSLRandomSeed;
+    }
 }

Modified: tomcat/container/tc5.5.x/webapps/docs/apr.xml
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/apr.xml?rev=795039&r1=795038&r2=795039&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/apr.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/apr.xml Fri Jul 17 11:02:40 2009
@@ -103,11 +103,39 @@
 	
   </section>
 
+  <section name="APR Configuration">
+  
+    <p>
+    The APR library is configured by the <code>AprLifecycleListener</code>. This
+    listener is configured as a global listener under the <code>Server</code>
+    element in <code>server.xml</code>. If the listener can't find the APR/native
+    library when it started, the library path it searched will be displayed.
+    </p>
+    <p>
+    The following attributes are supported by the
+    <code>AprLifecycleListener</code>: 
+    </p>
+  
+    <attributes>
+      <attribute name="className" required="true">
+        <p>This must be
+        <code>org.apache.catalina.core.AprLifecycleListener</code></p>
+      </attribute>
+      <attribute name="SSLRandomSeed" required="false">
+        <p>Sets the source of entropy. Production system needs a reliable source
+        of entropy but entropy may need a lot of time to be collected therefore
+        test systems could use non-blocking entropy sources like
+        <code>/dev/urandom</code> that will allow quicker starts of Tomcat. The
+        default value is <code>builtin</code>.
+        </p>
+      </attribute>
+    </attributes>
+  </section>
   <section name="APR Components">
 
   <p>
-    Once the libraries are properly installed and available to Java (if loading fails, the library path
-    will be displayed), the Tomcat connectors will automatically use APR. Configuration of the connectors
+    Once the libraries are properly installed and available to Java, the Tomcat
+    connectors will automatically use APR. Configuration of the connectors
     is similar to the regular connectors, but have a few extra attributes which are used to configure
     APR components. Note that the defaults should be well tuned for most use cases, and additional
     tweaking shouldn't be required.

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=795039&r1=795038&r2=795039&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Fri Jul 17 11:02:40 2009
@@ -121,6 +121,11 @@
         even if a role was found. (rjung)
       </fix>
       <fix>
+        <bug>39997</bug>: Add the SSLRandomSeed option to the
+        AprLifecycleListener to enable faster starts on development systems.
+        (markt)
+      </fix>
+      <fix>
         <bug>41407</bug>: JAAS Realm now works with CLIENT-CERT authentication.
         (markt)
       </fix>



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