By default, HTTPS / SSL is not configured and enabled in Tomcat Web server. SSL setup is required to make your web application accessible over HTTPS protocol. This post will guide you to configure SSL in Tomcat 7 Web server.

Tools and Technologies used in this article :

  1. Tomcat 7.0.47

  2. JDK 7

Note : Here, I have used apache-tomcat-7.0.47.tar.gz binary distribution. Settings will be different for Tomcat native library (APR).

 

1. Create Keystore and Self-signed Certificate

Open command prompt and go to %JAVA_HOME%\bin. Use keytool to create JKS (Java KeyStore) format keystore and a self-signed certificate.


 C:\jdk\bin>keytool -genkey -alias srccodes -keyalg RSA -keystore c:\tomcat7\conf\srccodes.jks

 

-keystoreFilepath : (say "c:\tomcat7\conf\srccodes.jks") where keystore file will be generated.

keystore password : Password of the keystore to be used by Tomcat. If not provided, then default is "changeit".

key password : Password of the self-signed certificate generated in the keystore. If not provided, then it'll be same as keystore password.

 

Continue Reading -->