How to Setup SSL Certificate in Tomcat 8 - Received from SSLS.COM

Configuring SSL certificate in Tomcat first time may take lot of time. SSL certificate setup in Tomcat is not straight forward for two reasons:

  1. There are different type of SSL certificate files and follow different encodings, depending on the certificate provider
  2. There are may differences in configuration steps in different versions of Tomcat
I recently configured SSL certificate for one of my website, the certificate was pruchased from for obvious reasons i.e. their rates are very good. 

How to get SSL Certificate from

  1. Purchased SSL certificate from
  2. To generate and download SSL certificate, we need to provide CSR (Certificate Signing Request) in account. Enter your website details at, it would generate the command. 
  3. Enter that command in Linux CLI, it would generate the CSR file and KEY file (its your private key so must be kep confidential). We would later use this file when configuring cert in Tomcat. 
  4. Login to account and enter the CSR file content to generate/download SSL certificate.
  5. Before you download the certificate, you need to verify the domain. provide a text file to be uploaded at website e.g.

  6. Click on domain verify link in, after login. After some time, the domain would be verified. 
  7. Download the certificate from com by clicking the download link. It shall download a zip file that contains 3 files i.e.,,

How to Setup SSL in Tomcat.
  1. Convert p7b file to pem file ... using some OpenSSL command or some online converter e.g.
  2. Combine your private key and and certificate in one PKCS#12 format file. Tomcat requires single file carrying certificate + private key, the pkcs12 type file may caontian multiple cryptographic objects (certificate and key, in our case). It would prompt you to setup password, give it, we would later use that password in Tomcat configuration.
    >openssl pkcs12 -inkey -in -export -out
  3. You may view certificate infor using openssl command:
    >openssl pkcs12 -in -noout -info
  4. Configure Connector in Tomcat 8 in server.xml file placed at conf folder, as per below given details. Replace 8443 to 443 in server.xml, as the default port of SSL is 443. Tomcat by default configure it to 8443.

    <Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" keystoreType="PKCS12" scheme="https" secure="true" keystoreFile="/" keystorePass="mypassword" clientAuth="false" sslProtocol="TLS" />
  5. Open web.xml of your web project and add security-constraint configuration as given below:<security-constraint>
  6. Access your website from browser, it shall open in https.