We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

A step-by-step guide to set up SSL/TLS certificate in Tomcat server.

tomcat-ssl

One of the essential tasks forsecuring Tomcatis to configure SSL certificate, so web system is accessible overHTTPS.

There are many ways to achieve this.

In this article, we will do as below.

tomcat-over-https

We will usekeytoolutility to manage the certificates.

There is two variable in above commands which you may want to change.

Ex:

Pay attention tothe first and last name question.

tomcat-ssl-labs

This is a bit of misleading I think.

Its not your name but the domain name which you want to secure.

Once you provide all the information, it will create a keystore file on a present working directory.

Next would be togenerate a new CSRwith the newly created keystore with below command.

This will create a CSR which you better send to the certificate authority to get it signed.

If you are playing around, then you may consider usinga FREE certificate providerelse go for a premium one.

I got the certificate signed and will proceed toimport into keystorewith below command.

Note: without importing root & intermediate, you wont be able to import domain certificate into keystore.

If you have more than one intermediate, then you got to import them all.

and, you will get a confirmation that it was installed.

Certificate reply was installed in keystore

Great, so certificate keystore is ready now.

Lets move to the next step.

If you are new to SSL and interested to know more then enroll in this online course SSL/TLS Operations.

Standard HTTPS Port

Why?

To do so, edit server.xml with your favorite editor

Impressive, its a success!

SSL/TLS Vulnerability Test

Finally, we will perform a test to ensure its notvulnerable to online threats.

There are many online tools which Idiscussed here, and here I will use SSL Labs.

And itsGREEN A rating.

So that was all for today.

I hope this helps you to know the procedure of securing Tomcat with SSL/TLS certificate.

If you are interested in learning more then I would highly recommend thiscourse.