How to Configure a Self-Signed Certificate in Apache Tomcat?

Published: 30 July 2024
on channel: The Journey of DevOps
276
20

Generate the Keystore and Certificate:
keytool -genkeypair -alias tomcat -keyalg RSA -keystore C:\Apache\Tomcat\conf\keystore.jks -keysize 2048
Edit the Connector Configuration in server.xml file :
Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="C:\Apache\Tomcat\conf\keystore.jks" keystorePass="password"

If you want to use .p12 format then convert JKS to PKCS12.
Convert JKS to PKCS12
keytool -importkeystore -srckeystore "C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\keystore.jks" -destkeystore "C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\keystore.p12" -deststoretype pkcs12
Edit the Connector Configuration in server.xml file :

Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\keystore.p12" keystorePass="your_new_keystore_password" keystoreType="PKCS12"


Watch video How to Configure a Self-Signed Certificate in Apache Tomcat? online, duration hours minute second in high quality that is uploaded to the channel The Journey of DevOps 30 July 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 276 times and liked it 20 visitors.