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.
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).
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):
keytool -certreq -alias tomcat -file tomcat.csr -keystore .keystore
openssl x509 -CA ca.crt -CAkey ca.key -in tomcat.csr -out tomcat.crt -req -CAcreateserial -days 500
keytool -import -file ca.crt -alias RootCert
keytool -import -file tomcat.crt -alias tomcat
keytool -import -keystore $(JAVA_HOME)/jre/lib/security/cacerts -file ca.crt