public static int TCN_PATCH_VERSION = 0;
/* TCN_IS_DEV_VERSION */
public static int TCN_IS_DEV_VERSION = 0;
+ /* TCN_FULL_VERSION */
+ public static int TCN_FULL_VERSION = 0;
/* APR_MAJOR_VERSION */
public static int APR_MAJOR_VERSION = 0;
/* APR_MINOR_VERSION */
TCN_MINOR_VERSION = version(0x02);
TCN_PATCH_VERSION = version(0x03);
TCN_IS_DEV_VERSION = version(0x04);
+ TCN_FULL_VERSION = TCN_MAJOR_VERSION * 1000 +
+ TCN_MINOR_VERSION * 100 +
+ TCN_PATCH_VERSION;
APR_MAJOR_VERSION = version(0x11);
APR_MINOR_VERSION = version(0x12);
APR_PATCH_VERSION = version(0x13);
}
// SSL protocol
- int value = SSL.SSL_PROTOCOL_ALL;
- if ("SSLv2".equalsIgnoreCase(SSLProtocol)) {
- value = SSL.SSL_PROTOCOL_SSLV2;
- } else if ("SSLv3".equalsIgnoreCase(SSLProtocol)) {
- value = SSL.SSL_PROTOCOL_SSLV3;
- } else if ("TLSv1".equalsIgnoreCase(SSLProtocol)) {
- value = SSL.SSL_PROTOCOL_TLSV1;
- } else if ("SSLv2+SSLv3".equalsIgnoreCase(SSLProtocol)) {
- value = SSL.SSL_PROTOCOL_SSLV2 | SSL.SSL_PROTOCOL_SSLV3;
- } else if ("all".equalsIgnoreCase(SSLProtocol) ||
- SSLProtocol == null || SSLProtocol.length() == 0) {
- // NOOP, use the default defined above
+ int value;
+ // This branch can be removed, once the required version is at least 1.1.21.
+ if (Library.TCN_FULL_VERSION <= 1120) {
+ value = SSL.SSL_PROTOCOL_ALL;
+ if ("SSLv2".equalsIgnoreCase(SSLProtocol)) {
+ value = SSL.SSL_PROTOCOL_SSLV2;
+ } else if ("SSLv3".equalsIgnoreCase(SSLProtocol)) {
+ value = SSL.SSL_PROTOCOL_SSLV3;
+ } else if ("TLSv1".equalsIgnoreCase(SSLProtocol)) {
+ value = SSL.SSL_PROTOCOL_TLSV1;
+ } else if ("SSLv2+SSLv3".equalsIgnoreCase(SSLProtocol)) {
+ value = SSL.SSL_PROTOCOL_SSLV2 | SSL.SSL_PROTOCOL_SSLV3;
+ } else if ("all".equalsIgnoreCase(SSLProtocol) ||
+ SSLProtocol == null || SSLProtocol.length() == 0) {
+ // NOOP, use the default defined above
+ } else {
+ // Protocol not recognized, fail to start as it is safer than
+ // continuing with the default which might enable more than the
+ // is required
+ throw new Exception(sm.getString(
+ "endpoint.apr.invalidSslProtocol", SSLProtocol));
+ }
} else {
- // Protocol not recognized, fail to start as it is safer than
- // continuing with the default which might enable more than the
- // is required
- throw new Exception(sm.getString(
- "endpoint.apr.invalidSslProtocol", SSLProtocol));
+ value = SSL.SSL_PROTOCOL_NONE;
+ if (SSLProtocol == null || SSLProtocol.length() == 0) {
+ value = SSL.SSL_PROTOCOL_ALL;
+ } else {
+ for (String protocol : SSLProtocol.split("\\+")) {
+ protocol = protocol.trim();
+ if ("SSLv2".equalsIgnoreCase(protocol)) {
+ value |= SSL.SSL_PROTOCOL_SSLV2;
+ } else if ("SSLv3".equalsIgnoreCase(protocol)) {
+ value |= SSL.SSL_PROTOCOL_SSLV3;
+ } else if ("TLSv1".equalsIgnoreCase(protocol)) {
+ value |= SSL.SSL_PROTOCOL_TLSV1;
+ } else if ("all".equalsIgnoreCase(protocol)) {
+ value |= SSL.SSL_PROTOCOL_ALL;
+ } else {
+ // Protocol not recognized, fail to start as it is safer than
+ // continuing with the default which might enable more than the
+ // is required
+ throw new Exception(sm.getString(
+ "endpoint.apr.invalidSslProtocol", SSLProtocol));
+ }
+ }
+ }
}
// Create SSL Context
either a blocking Java based connector or an APR/native based connector.
If the <code>PATH</code> (Windows) or <code>LD_LIBRARY_PATH</code> (on
most unix systems) environment variables contain the Tomcat native
- library, the native/APR connector will be used. If the native library
+ library, the APR/native connector will be used. If the native library
cannot be found, the blocking Java based connector will be used. Note
- that the native/APR connector has different settings for HTTPS than the
+ that the APR/native connector has different settings for HTTPS than the
Java connectors.<br/>
To use an explicit protocol rather than rely on the auto-switching
mechanism described above, the following values may be used:<br/>
<attribute name="SSLProtocol" required="false">
<p>Protocol which may be used for communicating with clients. The default
- is "all", with other acceptable values being "SSLv2", "SSLv3", "TLSv1"
- and "SSLv2+SSLv3".</p>
+ value is <code>all</code>, with other acceptable values being <code>SSLv2</code>,
+ <code>SSLv3</code>, <code>TLSv1</code> and <code>SSLv2+SSLv3</code>.
+ Starting with version 1.1.21 of the Tomcat native
+ library any combination of the three protocols concatenated with a
+ plus sign will be supported. Note that the protocol <code>SSLv2</code>
+ is inherently unsafe.</p>
</attribute>
<attribute name="SSLVerifyClient" required="false">