Assuming you have already properly installed JDK1.4 and Tomcat, you can follow the steps to set up Tomcat to use SSL connection if you're using openSSL.

## Install openssl and set up the CA

Assume that openssl is installed, here are the steps to generate the ca certificate:

        openssl req -new -newkey rsa:512 -nodes -out ca.req -keyout ca.key

        openssl x509 -trustout -signkey ca.key -days 365 -req -in ca.req -out ca.crt

Now the files 'ca.key' and 'ca.crt' exist (the CA's signing key and certificate, respectively).

## Set up Tomcat to use SSL connection

1. For Tomcat, edit conf/server.xml to enable SSL.
2. Generate a new server private key for Tomcat in local keystore, use server's DNS name as common name.

           keytool -genkey -alias tomcat -keyalg RSA -validity 500 -keystore .keystore

           Here is an example for wazoo.stanford.edu:
               D:\>keytool -genkey -alias tomcat -keyalg RSA -validity 500 -keystore .keystore
               Enter keystore password:  ustorit
               What is your first and last name?
                 [Unknown]:  wazoo.stanford.edu
               What is the name of your organizational unit?
                 [Unknown]:  CSD
               What is the name of your organization?
                 [Unknown]:  Stanford University
               What is the name of your City or Locality?
                 [Unknown]:  Palo Alto
               What is the name of your State or Province?
                 [Unknown]:  California
               What is the two-letter country code for this unit?
                 [Unknown]:  US
               Is CN=wazoo.stanford.edu, OU=CSD, O=Stanford University, L=Palo Alto, ST=California, C=US correct?
                 [no]:  yes

               Enter key password for
                       (RETURN if same as keystore password):

3. Generate a certificate signing request for Tomcat.

           keytool -certreq -alias tomcat -file tomcat.csr -keystore .keystore

4. Go to the computer running CA (e.g. Wazoo), sign the request to generate server certificate.

           openssl x509 -CA ca.crt -CAkey ca.key -in tomcat.csr -out tomcat.crt -req -CAcreateserial -days 500

5. Import CA cert and tomcat server cert into the .keystore file

           keytool -import -file ca.crt -alias RootCert

           keytool -import -file tomcat.crt -alias tomcat

6. Import CA cert into JRE cacerts file

           keytool -import -keystore $(JAVA_HOME)/jre/lib/security/cacerts -file ca.crt