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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • How Java Servlets Work: The Backbone of Java Web Apps
  • JMeter Plugin HTTP Simple Table Server (STS) In-Depth
  • Optimizing Database Connectivity: A Comparative Analysis of Tomcat JDBC vs. HikariCP
  • Types of Bot Traffic on a Public Internet Website

Trending

  • The Evolution of Scalable and Resilient Container Infrastructure
  • Using Java Stream Gatherers To Improve Stateful Operations
  • Implementing Explainable AI in CRM Using Stream Processing
  • Designing a Java Connector for Software Integrations
  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.5K 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 Java Servlets Work: The Backbone of Java Web Apps
  • JMeter Plugin HTTP Simple Table Server (STS) In-Depth
  • Optimizing Database Connectivity: A Comparative Analysis of Tomcat JDBC vs. HikariCP
  • Types of Bot Traffic on a Public Internet Website

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!