How to use HTTPS in Tomcat?

This is just a short note about how to use https in Tomcat (7)…

First, we have to generate a key with a password, e.g. qwerty:

“%JAVA_HOME%\bin\keytool” -genkey -alias tomcat -keyalg RSA -keystore /etc/tomcat7/tomcat.keystore

Then, we need to edit the /etc/tomcat7/server.xml file — uncomment connector ssl 8443 there and add attributes keystoreFile and keystorePass:

keystoreFile=”/etc/tomcat7/tomcat.keystore”
keystorePass=”qwerty”

At the end, remember to restart tomcat7 service: sudo service tomcat7 restart.

For more info, please visit https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html.

Skomentuj

Leave a Reply

Your email address will not be published. Required fields are marked *