Tomcat Documentation:
Code:
jsse jars MUST BE IN BOTH CLASSPATH and $JAVA_HOME/jre/lib/ext (JAVA > 1.2)
from server.xml doc.You _need_ to set up a server certificate if you want this to work, and you need JSSE.
Add JSSE jars to CLASSPATH
Edit $JAVA_HOME/jre/lib/security/java.security
Add: security.provider.2=com.sun.net.ssl.internal.ssl.Provider
Do: keytool -genkey -alias tomcat -keyalg RSA
RSA is essential to work with Netscape and IIS. Use "changeit" as password (or add keypass attribute). You don't need to sign the certificate. You can set parameter keystore and keypass if you want to change the default ($HOME/.keystore with changeit)
I suggest you install jcert.jar, jnet.jar and jsse.jar in $JAVA_HOME/jre/lib/ext and then add them to your CLASSPATH export
CLASSPATH=$JAVA_HOME/jre/lib/ext/jcert.jar:$CLASSPATH
export CLASSPATH=$JAVA_HOME/jre/lib/ext/jnet.jar:$CLASSPATH
export CLASSPATH=$JAVA_HOME/jre/lib/ext/jsse.jar:$CLASSPATH
You could also copy the 3 jars into $TOMCAT_HOME/lib/ so they are under the existing CLASSPATH at tomcat startup (tomcat.sh).
My Translation:
1) Go download JSSE at
. You will need to register and all that jazz.
2) Unzip the file and copy the contents of lib into your JAVA_HOME/jre/lib/ext directory. Also copy these to TOMCAT_HOME/lib.
3) Add the jar files to your System CLASSPATH.
4) Open JAVA_HOME/jre/lib/security/java.security and add a new provider Security provider list: security.provider.3=com.sun.net.ssl.internal.ssl.Provider
5) Generate your key file by running:
keytool -genkey -alias tomcat -keyalg RSA
Additionally you can specify the location for the .keystore file with the -keystore option. The default location is USER_HOME/. The Tomcat instructions give a bit more info on this piece. It is pretty straight-forward.
6) Place the .keystore file where ever you like and edit your Tomcat server.xml file. Specifically you need the following:
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
<Parameter name="port" value="8443"/>
Your Choice
<Parameter name="socketFactory" value="org.apache.tomcat.net.SSLSocketFactory"/>
<Parameter name="keystore" value="/var/tomcat/conf/keystore" />
Your Choice
<Parameter name="keypass" value="changeit"/>
Your Choice
<Parameter name="clientAuth" value="true"/>
</Connector>
That should be it. I am going to write another post explaining the whole Verisign thing and why it is important.
Wushutwist