- Create a keystore file to store the server's private key and self-signed certificate by executing the following command:
Windows:
"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
Unix:
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
- Uncomment the "SSL HTTP/1.1 Connector" entry in $CATALINA_BASE/conf/server.xml
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
2.1 modify the keystoreFile path with the path where you have placed the .keystore
2.2 modify keystorePass with the password you have entered while creating .keystore
Note: Make sure .keystore file is in user home because by default server.xml will check there.
Reference link