June 1, 2012

How to install install and configure SSL on Tomcat 7

In my previous blog I described how to install and configure SSL on Jboss 5.1 (http://magnus-k-karlsson.blogspot.se/2012/05/how-to-install-install-and-configure.html) and in this blog I will how to do the same but for Tomcat 7. And you will see it is very similar. And the reason for that is that JBoss is actually using Tomcat as web container. So to configure SSL on Tomcat follow the same step as in my previous blog to create server certificate and then open server.xml add the following configuration for the https Connector.

$CATALINA_HOME/conf/server.xml:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
        maxThreads="150" scheme="https" secure="true"
        clientAuth="false" sslProtocol="TLS" 
        keystoreFile="${catalina.base}/conf/server.keystore"
        keystorePass="changeit" />
Then reuse the previous test application and open your browser. Here you will get a warning about a self-signed certificate. Accept it and you will see your application.

No comments: