Index: container/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java =================================================================== --- container/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java (revision 793320) +++ container/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java (working copy) @@ -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; + } } Index: container/webapps/docs/apr.xml =================================================================== --- container/webapps/docs/apr.xml (revision 793320) +++ container/webapps/docs/apr.xml (working copy) @@ -103,11 +103,39 @@ +
+ +

+ The APR library is configured by the AprLifecycleListener. This + listener is configured as a global listener under the Server + element in server.xml. If the listener can't find the APR/native + library when it started, the library path it searched will be displayed. +

+

+ The following attributes are supported by the + AprLifecycleListener: +

+ + + +

This must be + org.apache.catalina.core.AprLifecycleListener

+
+ +

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 + /dev/urandom that will allow quicker starts of Tomcat. The + default value is builtin. +

+
+
+

- 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.