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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s