Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
Last active July 24, 2017 16:55
Show Gist options
  • Save mohanpedala/2fc3b23fe15165faa10d3a9e96ab3ee4 to your computer and use it in GitHub Desktop.
Save mohanpedala/2fc3b23fe15165faa10d3a9e96ab3ee4 to your computer and use it in GitHub Desktop.
Tomcat_SSL configuration
  1. 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

  1. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment