An easy way to enable SSL for Tomcat servers inside Eclipse

This should be easy, but Tomcat’s guideline is a little confusing.

First, create a keystore with JDK’s keytool. Remember to use the default password by not putting any password when being prompted. The default password should be “changeit”.

%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA

The generated keystore should be in the user’s directory, e.g. C:\Users\username\.keystore.

Then go to view Project Explorer in Eclipse, look for your Tomcat server’s configuration file server.xml under the project Servers. Uncomment the following line:


I don’t know why, but Tomcat servers inside Eclipse use the JSSE implementation instead of APR implementation.

You can remap your server’s ports by double click on it in view Servers.

Now your Tomcat server is SSL-enabled.