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:


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

For more info, please visit


Leave a Reply

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