From 1a94358e1c79dfc10c981b6d9dc1afa3ead47f74 Mon Sep 17 00:00:00 2001
From: markt IMPORTANT NOTE: This Howto refers to usage of JSSE, that comes included with
- jdk 1.5 and higher. When using APR, Tomcat will
- use OpenSSL, which uses a different configuration. The description below uses the variable name $CATALINA_BASE to refer the
base directory against which most relative paths are resolved. If you have
@@ -60,7 +56,8 @@ $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
$CATALINA_BASE/conf/server.xml and tweak as necessary.$CATALINA_BASE/conf/server.xml and modify as described in
+ the Configuration section below.
@@ -267,6 +264,7 @@ sure that the information provided here matches what they will expect.
keytool prompt will tell you that pressing the
ENTER key does this for you automatically.)
@@ -282,6 +280,41 @@ which contains further references for this issue.
+Tomcat can use two different implementations of SSL: +
+ To avoid auto configuration you can define which implementation to use by specifying a classname
+ in the protocol attribute of the Connector.
+ To define a Java (JSSE) connector, regardless of whether the APR library is loaded or not do:
+
If you are using APR, you have the option of configuring an alternative engine to OpenSSL.
The final step is to configure your secure socket in the +
The final step is to configure the Connector in the
$CATALINA_BASE/conf/server.xml file, where
$CATALINA_BASE represents the base directory for the
Tomcat 6 instance. An example <Connector> element
for an SSL connector is included in the default server.xml
-file installed with Tomcat. It will look something like this:
The example above will throw an error if you have the APR and the Tomcat Native libraries in your path,
- as tomcat will try to autoload the APR connector. The APR connector uses different attributes for
- SSL keys and certificates. An example of such configuration would be
+ as Tomcat will try to use the APR connector. The APR connector uses different attributes for
+ SSL keys and certificates. An example of an APR configuration is:
- To avoid auto configuration you can define which connector to use by specifying a classname
- in the protocol attribute.
- To define a Java connector, regardless if the APR library is loaded or not do:
-
You will note that the Connector element itself is commented out by default, @@ -406,111 +392,17 @@ numbers lower than 1024 on many operating systems.
value specified for theredirectPort attribute on the
non-SSL connector. This allows Tomcat to automatically redirect
users who attempt to access a page with a security constraint specifying
- that SSL is required, as required by the Servlet 2.4 Specification.
+ that SSL is required, as required by the Servlet Specification.
-There are additional options used to configure the SSL protocol. - You may need to add or change the following attribute -values, depending on how you configured your keystore earlier:
- -| Attribute | -Description | -
|---|---|
clientAuth |
- Set this value to true if you want Tomcat to require
- all SSL clients to present a client Certificate in order to use
- this socket. Set this value to want if you want Tomcat
- to request a client Certificate, but not fail if one isn't presented.
- A false value (which is the default) will not require a
- certificate chain unless the client requests a resource protected by a
- security constraint that uses CLIENT-CERT authentication.
- |
-
SSLEnabled |
-
- Use this attribute to enable SSL traffic on a connector.
- To turn on SSL handshake/encryption/decryption on a connector
- set this value to true.
- The default value is false.
- When turning this value true you will want to set the
- scheme and the secure attributes as well
- to pass the correct request.getScheme() and
- request.isSecure() values to the servlets
- |
-
keystoreFile |
- Add this attribute if the keystore file you created is not in
- the default place that Tomcat expects (a file named
- .keystore in the user home directory under
- which Tomcat is running). You can specify an absolute pathname,
- or a relative pathname that is resolved against the
- $CATALINA_BASE environment variable. |
-
keystorePass |
- Add this element if you used a different keystore (and Certificate)
- password than the one Tomcat expects (changeit). |
-
keystoreType |
- Add this element if using a keystore type other than JKS.
- For example the *.p12 files from OpenSSL can be used using PKCS12. |
-
sslProtocol |
- The encryption/decryption protocol to be used on this socket.
- It is not recommended to change this value if you are using Sun's
- JVM. It is reported that IBM's 1.4.1 implementation
- of the TLS protocol is not compatible with some popular browsers.
- In this case, use the value SSL. |
-
ciphers |
- The comma separated list of encryption ciphers that this socket is - allowed to use. By default, the default ciphers for the JVM will be - used. Note that this usually means that the weak export grade ciphers - will be included in the list of available ciphers. The ciphers are - specified using the JSSE cipher naming convention. | -
algorithm |
- The X509 algorithm to use. This defaults to the Sun
- implementation (SunX509). For IBM JVMs you should use
- the value IbmX509. For other vendors, consult the JVM
- documentation for the correct value.
- |
-
truststoreFile |
- The TrustStore file to use to validate client certificates. | -
truststorePass |
- The password to access the TrustStore. This defaults to the value
- of keystorePass. |
-
truststoreType |
- Add this element if your are using a different format for the - TrustStore then you are using for the KeyStore. | -
keyAlias |
- Add this element if your have more than one key in the KeyStore. - If the element is not present the first key read in the KeyStore - will be used. | -
crlFile |
- The certificate revocation list file to use to validate client - certificates. | -
There are additional options used to configure the SSL protocol. You may +need to add or change some attributes, depending on how you configured your +keystore earlier. If you are using a Java JSSE based SSL connector then +configuration options are documented in the +Java HTTP connector configuration +reference. If you are using the APR/native connector then refer to the +APR connector configuration guide for details of the +available configuration options.
After completing these configuration changes, you must restart Tomcat as you normally do, and you should be in business. You should be able to access -- 2.11.0