DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How to Verify Domain Ownership: A Technical Deep Dive
  • Designing Embedded Web Device Dashboards
  • How Java Servlets Work: The Backbone of Java Web Apps
  • JMeter Plugin HTTP Simple Table Server (STS) In-Depth

Trending

  • Spec-Driven Integration: Turning API Sprawl Into a Governed Capability Fleet for AI
  • The Third Culture: Blending Teams With Different Management Models
  • DevOps Is Dead, Long Live Platform Engineering
  • Edge Computing in Utility IoT: Two Architecture Patterns That Actually Work
  1. DZone
  2. Coding
  3. Languages
  4. Install SSL Certificate on Tomcat Web Server

Install SSL Certificate on Tomcat Web Server

Learn how you can install an SSL certificate on an Apache Tomcat web server.

By 
Jake Adley user avatar
Jake Adley
·
Feb. 26, 19 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
15.7K Views

Join the DZone community and get the full member experience.

Join For Free

Tomcat Web Server: SSL Certificate Installation Procedure

To successfully install your SSL Certificate on a Tomcat web server, you need to configure the root (SSL) certificate, intermediate/primary certificate, and private key within the appropriate Keystore.

  • Download Certificate Files
  • Import Root Certificate
  • Import Intermediate Certificate
  • Install SSL Certificate

Perform the following steps when installing the SSL certificate on Tomcat Web Server.

Install SSL Certificate Into the Keystore

Step 1: Download and Extract the SSL Certificate

After order completion, Certificate Authority (CA) will send an email containing a *.zip file, which includes the root, intermediate, and primary certificate files. Download and extract the files on the Tomcat Web Server directory where the Keystore was added during the Certificate Signing Request (CSR) generation process.

Note: SSL certificate will work only with the same Keystore, which was created during the CSR generation process. Also, make sure to install all certificate files in the correct order on the Keystore.

Step 2: Import Root Certificate File

During the process of installing the SSL certificate to the Keystore, the password required is the same one that you created during the CSR generation process. Now, to import the Root certificate file, enter the following command/code:

keytool -import -trustcacerts -alias root -file RootCertFileName.crt -keystore keystore.key


After entering this command, if you receive a message that says “Certificate already exists in system-wide CA Keystore under alias <…> Do you still want to add it to your own Keystore? [no]:” then select Yes.

If this process is successfully completed, it will display this message: “Certificate was added to Keystore.”

Step 3: Import Intermediate Certificate File

Add the following command/code to import the intermediate certificate file:

keytool -import -trustcacerts -alias intermediate -file IntermediateCertFileName.crt -keystore keystore.key


If this process is successfully completed, it will display this message: “Certificate was added to Keystore.”

Step 4: Installing the Primary Certificate File

Add the following command/code to install the primary certificate file:

keytool -import -trustcacerts -alias tomcat -file PrimaryCertFileName.crt -keystore keystore.key


If this process is successfully completed, it will display this message: “Certificate was added to Keystore.”

After installing the SSL Certificate file into your Keystore, the next step is the server configuration for using the Keystore file.

SSL Connector Configuration

Note: Configuration of ‘SSL Connector’ must be required for Tomcat to accept a secure connection.

In the system’s home directory, Tomcat is mainly looking for the Keystore with file name .keystore and default password as ‘changeit.’ On Unix and Linux systems, the home directory will be /home/user-name/, and for Microsoft Windows systems, it will be C:\Documents and Settings\user-name\. Users can change the file location and password if required.

1. Copy Keystore file (your-domain-name.key) into the home directory
2. Now, using any text-editor open …~/conf/server.xml file.
3. If necessary, uncomment the SSL connector.
4. Locate the SSL connector for which the new Keystore will be used. Make sure the Connector Port is 443.
5. During configuration of SSL connector, add the exact location of the Keystore file name and also the correct KeystorePass.
6. If the Tomcat version is 7.0.X or 8.0.X, then replace the KeystorePass with Keypass.

Once the connector configuration process is finished, it will  look something like this:

<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=”org.apache.catalina.net.SSLServerSocketFactory” clientAuth=”false” protocol=”TLS” 
keystoreFile=”/working/mykeystore” keystorePass=”password”/>


7. Save the server.xml file and restart Tomcat server.

With this step, the SSL certificate is now successfully installed the on Tomcat web server.

Apache Tomcat Web server

Published at DZone with permission of Jake Adley. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Verify Domain Ownership: A Technical Deep Dive
  • Designing Embedded Web Device Dashboards
  • How Java Servlets Work: The Backbone of Java Web Apps
  • JMeter Plugin HTTP Simple Table Server (STS) In-Depth

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook