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 without registration, duration hours minute second in high quality. This video was added by user The Journey of DevOps 30 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 276 once and liked it 20 people.