Install SSL/TLS Certificate on Apache Tomcat

1. Use a text editor like vi,vim or nano to open the Tomcat server.xml file.

Typically, the server.xml file is in the conf folder in your Tomcat’s home directory.

2. Locate the connector you want the new certificateFile to secure.

Usually, a connector with port 8443 is used; see step 4. Note that you may need to uncomment the connector – remove the comment tags (<!– and –>).

3. Configure your Tomcat connector.

Make sure to specify your certificate and private key filename in your connector configuration. certificateChainFile is an optional parameters but its is recommended to add that too.

4. When you are done, your connector should look something like the example below.

<Connector port=”8443” protocol=”org.apache.coyote.http11.Http11AprProtocol”
maxThreads=”150″ SSLEnabled=”true” >
<UpgradeProtocol className=”org.apache.coyote.http2.Http2Protocol” />
<SSLHostConfig>
<Certificate certificateKeyFile=”conf/localhost-rsa-key.pem”
certificateFile=”conf/localhost-rsa-cert.pem”
certificateChainFile=”conf/localhost-rsa-chain.pem”
type=”RSA” />
</SSLHostConfig>
</Connector>

In the connector configuration above, certificateFile is the path to your SSL/TLS certificate file, certificateKeyFile is the path to your private key file.

5. Save your changes to the server.xml file.

6. Restart the Tomcat service.

7. Congratulations! You’ve successfully installed your SSL certificate.

 

If this solution helped you then please click on any of the ads on this page to support us.

Leave a Reply

Your email address will not be published. Required fields are marked *

eight − 2 =