How to Install SSL Certificate on Tomcat?

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Install SSL On Apache Tomcat

Steps to Begin Installation of SSL on Tomcat

Are you looking to secure your Tomcat server with SSL but don’t know where to start? Look no further! This comprehensive guide will take you through all the crucial steps of a proper SSL installation in Tomcat. So, let’s jump right into the installation process to safeguard your server security.

Let’s get started!

First Things First: Generate CSR

CSR (Certificate Signing Request) comprises domain ownership and company information. This is how you can generate it.

  • Open our CSR Generator Tool
  • Fill in the Required Information
  • Choose a Key Size and Algorithm
  • Generate the CSR

Here is a step-by-step process of installing an SSL certificate on Tomcat server.

Step-1: Downloading and Extracting the SSL certificate sent by the CA

When you purchase an SSL certificate, the certificate authority will email you a compressed file that contains root, intermediate, & primary certificate files for installation. Download & extract them onto the Tomcat web server directly. This is where the Keystore was added while the CSR was generated.

Always remember that the SSL certificate will only work with the Keystore created during the CSR generation process. In case you use a different key store, the certificate won’t function correctly. Moreover, please make sure that all the certificate files are installed in the correct order on the key store. Failing to do so, could result in issues with the SSL installation and potentially compromise your website’s security.

Step-2: Importing the Root Certificate

  • Open the command prompt or the terminal window.
  • Navigate to the Java installation directory by using the ‘cd’ command.
cd C:\Program Files\Java\jdk1.8.0_211\bin
  • import the root certificate by running the following command:
keytool -import -trustcacerts -alias root -file [root certificate file path] -keystore [keystore file path]
  • Make sure to replace the ‘[root certificate file path]’ and ‘[key store file path]’ with the suitable paths relevant to your system.
  • Type ‘yes’ to accept the Certificate and hit Enter.
  • When the process is completed, it will show a message which reads like this ‘Certificate was added to Keystore.

Step-3: Importing the Intermediate Certificate

  • Import the intermediate certificate by running the following command
keytool -import -trustcacerts -alias intermediate -file [intermediate certificate file path] -keystore [keystore file path]
  • Make sure to replace the “[intermediate certificate file path]” and “[keystore file path]” with the appropriate paths on your system.
  • After completing this process, it will again show a message like this ‘Certificate was added to Keystore.

Step-4: Installing the Primary Certificate

  • Install the primary certificate by running the following command
keytool -import -trustcacerts -alias tomcat -file [primary certificate file path] -keystore [keystore file path]
  • Make sure to replace the “[primary certificate file path]” and “[keystore file path]” with the appropriate paths on your system.
  • The successful installation message will pop again after running the command.
  • After the successful installation of root, Intermediate, and primary certificate, the next step is to configure the server for using the Keystore file.

Step 5: Server Configuration

During the server configuration, Tomcat looks for the Keystore with the filename. Keystore and default password ‘change it’ in the home directory of the system.

For Linux and Unix OS, the directory can be found at /home/user-name/

For Windows users, you can find the directory at C:\Documents and Settings\user-name\

Note: The users can change the password and file location if they deem it is necessary.

  • Copy your-domain-name.key Keystore file to the home directory.
  • Open the server.xml file located in …~/conf/ using any text editor.
  • You may have to uncomment the SSL connector.
  • Find the SSL connector that will use the new Keystore. Ensure that the Connector Port is set to 443.
  • While configuring the SSL connector, specify the exact location of the Keystore file and the correct KeystorePass.

Note: If you are a user of Tomcat 7.0.X or 8.0.X, replace KeystorePass with Keypass in the configuration.

  • After completing the connector configuration process, it should appear like the following:
<Connector className="org.apache.catalina.connector.http.HttpConnector" port="8443" minProcessors="5" maxProcessors="75" enableLookups="true" acceptCount="10" debug="0" scheme="https" secure="true"> <Factory className="" clientAuth="false" protocol="TLS" keystoreFile="/working/mykeystore" keystorePass="password"/>
  • After making changes to the server.xml file, save the modifications and proceed to restart the Tomcat Server.
  • Once you have installed an SSL certificate in Tomcat, it’s important to regularly check for any unnoticed errors that could affect its performance. You can use SSL Checker Tool which provides instant scans and reports to do this.

Where to Find the SSL Certificate for Tomcat Web Server?

If you’re wondering where to buy the best SSL certificate for Tomcat, look no further than Certera. We are also partnered with the top Certificate Authorities in the industry and offer competitive prices for our range of SSL products. Our certificates are compatible with Tomcat servers and can secure various websites, from small blogs to giant enterprise websites.

Upgrade your Domain Security with Affordable and Trusted SSL Certificates from Certera starting at just $2.99/year

Buy SSL Certificates
<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="" viewBox="0 0 109.7 29.02"><defs><style>.cls-1{fill:#fff;}</style></defs><path class="cls-1" d="m5.38,22.85c-3.1-.26-5.3-1.92-5.38-4.8h3.6c.1,1.1.67,1.85,1.78,2.09v-4.58c-2.47-.62-5.38-1.32-5.38-4.87,0-2.83,2.26-4.68,5.38-4.92v-1.94h1.54v1.94c3,.24,5.02,1.85,5.23,4.7h-3.62c-.1-.94-.67-1.66-1.61-1.94v4.54c2.5.65,5.42,1.3,5.42,4.85,0,2.45-1.92,4.73-5.42,4.97v1.94h-1.54v-1.97Zm0-10.25v-4.15c-1.1.17-1.87.84-1.87,2.06,0,1.13.77,1.7,1.87,2.09Zm1.54,3.38v4.2c1.22-.22,1.94-1.06,1.94-2.14s-.82-1.68-1.94-2.06Z"/><path class="cls-1" d="m17.62,8.33h-2.33v-3.1h5.78v17.5h-3.46v-14.4Z"/><path class="cls-1" d="m28.27,17.81c.26,1.39,1.15,2.18,2.71,2.18,1.97,0,2.83-1.46,2.83-5.4-.74,1.03-2.16,1.63-3.7,1.63-3.02,0-5.45-1.9-5.45-5.59,0-3.5,2.21-5.81,5.91-5.81,4.75,0,6.22,3.22,6.22,8.76,0,5.95-1.32,9.17-5.95,9.17-3.72,0-5.5-2.38-5.69-4.94h3.12Zm5.23-7.15c0-1.92-1.1-2.98-2.81-2.98s-2.81,1.18-2.81,2.93c0,1.58.89,2.88,2.93,2.88,1.68,0,2.69-1.13,2.69-2.83Z"/><path class="cls-1" d="m41.28,22.9c-1.22,0-2.09-.86-2.09-1.97s.86-1.97,2.09-1.97,2.04.86,2.04,1.97-.86,1.97-2.04,1.97Z"/><path class="cls-1" d="m49.54,17.81c.26,1.39,1.15,2.18,2.71,2.18,1.97,0,2.83-1.46,2.83-5.4-.74,1.03-2.16,1.63-3.7,1.63-3.02,0-5.45-1.9-5.45-5.59,0-3.5,2.21-5.81,5.91-5.81,4.75,0,6.22,3.22,6.22,8.76,0,5.95-1.32,9.17-5.95,9.17-3.72,0-5.5-2.38-5.69-4.94h3.12Zm5.23-7.15c0-1.92-1.1-2.98-2.81-2.98s-2.81,1.18-2.81,2.93c0,1.58.89,2.88,2.93,2.88,1.68,0,2.69-1.13,2.69-2.83Z"/><path class="cls-1" d="m64.56,17.81c.26,1.39,1.15,2.18,2.71,2.18,1.97,0,2.83-1.46,2.83-5.4-.74,1.03-2.16,1.63-3.7,1.63-3.02,0-5.45-1.9-5.45-5.59,0-3.5,2.21-5.81,5.9-5.81,4.75,0,6.22,3.22,6.22,8.76,0,5.95-1.32,9.17-5.95,9.17-3.72,0-5.5-2.38-5.69-4.94h3.12Zm5.23-7.15c0-1.92-1.1-2.98-2.81-2.98s-2.81,1.18-2.81,2.93c0,1.58.89,2.88,2.93,2.88,1.68,0,2.69-1.13,2.69-2.83Z"/><path class="cls-1" d="m81.79,0h3.29l-6.48,27.07h-3.29L81.79,0Z"/><path class="cls-1" d="m96.89,9.43h3.58l-8.23,19.59h-3.58l2.88-6.62-5.33-12.96h3.77l3.43,9.29,3.48-9.29Z"/><path class="cls-1" d="m105.62,22.73h-3.36v-13.3h3.36v2.06c.84-1.37,2.23-2.26,4.08-2.26v3.53h-.89c-1.99,0-3.19.77-3.19,3.34v6.62Z"/></svg>