How to enable https for tomcat ?

Updated on September 2, 2017

Introduction to SSL

SSL stands for Secure Socket Layer, is a technology that provides secure connection between the web browser and web server. Means the data sent by one side is encrypted, transferred and decrypted on the other side of the communication.

Introduction to digital certificates

Before implementing secure connection, web server should have an digital certificate. In simple terms, digital certificates are like driver’s license for secure communication.

Introduction to JSSE

JSSE stands for Java Secure Socket Extension. JSSE is a jar which can be downloaded from SUN.com.  If you had built Tomcat from source, you have probably already downloaded this package.

Environment Variables

$CATALINA_HOME – Refers to Tomcat Installation directory.

Steps to enable https for tomcat :

  1. Download the JSSE package from http://java.sun.com/products/jsse/ and set the environment variable JSSE_HOME to the JSSE installation directory.
  2. Create a certificate keystore by executing the following command:
    Windows:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSAUnix:
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
  3. Uncomment the “SSL HTTP/1.1 Connector” entry in $CATALINA_HOME/conf/server.xmland tweak as necessary.See the line in server.xml for un-commenting.
    <!– Define a SSL Coyote HTTP/1.1 Connector on port 8443 –>
  4. Restart tomcat

Was this article helpful?

Related Articles

Leave a Comment