View | Details | Raw Unified | Return to bug 39997
Collapse All | Expand All

(-)container/catalina/src/share/org/apache/catalina/core/AprLifecycleListener.java (+14 lines)
Lines 47-52 Link Here
47
    protected StringManager sm =
47
    protected StringManager sm =
48
        StringManager.getManager(Constants.Package);
48
        StringManager.getManager(Constants.Package);
49
49
50
    protected static String SSLRandomSeed = "builtin";
50
    
51
    
51
    // -------------------------------------------------------------- Constants
52
    // -------------------------------------------------------------- Constants
52
53
Lines 80-85 Link Here
80
                Class clazz = Class.forName("org.apache.tomcat.jni.Library");
81
                Class clazz = Class.forName("org.apache.tomcat.jni.Library");
81
                Method method = clazz.getMethod(methodName, paramTypes);
82
                Method method = clazz.getMethod(methodName, paramTypes);
82
                method.invoke(null, paramValues);
83
                method.invoke(null, paramValues);
84
                
85
                methodName = "randSet";
86
                paramValues[0] = SSLRandomSeed;
87
                clazz = Class.forName("org.apache.tomcat.jni.SSL");
88
                method = clazz.getMethod(methodName, paramTypes);
89
                method.invoke(null, paramValues);
90
83
                major = clazz.getField("TCN_MAJOR_VERSION").getInt(null);
91
                major = clazz.getField("TCN_MAJOR_VERSION").getInt(null);
84
                minor = clazz.getField("TCN_MINOR_VERSION").getInt(null);
92
                minor = clazz.getField("TCN_MINOR_VERSION").getInt(null);
85
                patch = clazz.getField("TCN_PATCH_VERSION").getInt(null);
93
                patch = clazz.getField("TCN_PATCH_VERSION").getInt(null);
Lines 131-135 Link Here
131
139
132
    }
140
    }
133
141
142
    public String getSSLRandomSeed() {
143
        return SSLRandomSeed;
144
    }
134
145
146
    public void setSSLRandomSeed(String SSLRandomSeed) {
147
        AprLifecycleListener.SSLRandomSeed = SSLRandomSeed;
148
    }
135
}
149
}
(-)container/webapps/docs/apr.xml (-2 / +30 lines)
Lines 103-113 Link Here
103
	
103
	
104
  </section>
104
  </section>
105
105
106
  <section name="APR Configuration">
107
  
108
    <p>
109
    The APR library is configured by the <code>AprLifecycleListener</code>. This
110
    listener is configured as a global listener under the <code>Server</code>
111
    element in <code>server.xml</code>. If the listener can't find the APR/native
112
    library when it started, the library path it searched will be displayed.
113
    </p>
114
    <p>
115
    The following attributes are supported by the
116
    <code>AprLifecycleListener</code>: 
117
    </p>
118
  
119
    <attributes>
120
      <attribute name="className" required="true">
121
        <p>This must be
122
        <code>org.apache.catalina.core.AprLifecycleListener</code></p>
123
      </attribute>
124
      <attribute name="SSLRandomSeed" required="false">
125
        <p>Sets the source of entropy. Production system needs a reliable source
126
        of entropy but entropy may need a lot of time to be collected therefore
127
        test systems could use non-blocking entropy sources like
128
        <code>/dev/urandom</code> that will allow quicker starts of Tomcat. The
129
        default value is <code>builtin</code>.
130
        </p>
131
      </attribute>
132
    </attributes>
133
  </section>
106
  <section name="APR Components">
134
  <section name="APR Components">
107
135
108
  <p>
136
  <p>
109
    Once the libraries are properly installed and available to Java (if loading fails, the library path
137
    Once the libraries are properly installed and available to Java, the Tomcat
110
    will be displayed), the Tomcat connectors will automatically use APR. Configuration of the connectors
138
    connectors will automatically use APR. Configuration of the connectors
111
    is similar to the regular connectors, but have a few extra attributes which are used to configure
139
    is similar to the regular connectors, but have a few extra attributes which are used to configure
112
    APR components. Note that the defaults should be well tuned for most use cases, and additional
140
    APR components. Note that the defaults should be well tuned for most use cases, and additional
113
    tweaking shouldn't be required.
141
    tweaking shouldn't be required.

Return to bug 39997