Apache Tomcat, often referred to as Tomcat Server, is an open-source Java Servlet Container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment in which Java code can run.
This Tomcat Tutorial will show you how to create a self signed cert that you can then use to secure Tomcat.
Open a command prompt window and navigate to your JAVA_HOME bin folder, in our case:
Enter the command:
keytool -genkey -alias tomcat -keyalg RSA -keystore “C:\apache-tomcat-8.5.34\conf\localhost.jks”
Note: You should update the tomcat path to match your path
You will then be prompted for a series of values, in our case we entered:
enter Keystore password: password
retype keystore password: password
what is your first and last name: localhost
what is the name of your orgainsation unit: IT
what is the name of your organisation: Darren
what is the name of your city: Dublin
what is the name of your state or province: Leinster
What is the two-letter country code for this unit: IE
When prompted type yes to confirm all is correct.
Next you will be asked to use the same password for <tomcat>, press enter here:
Now open the tomcat server.xml file, in our case the file is located here:
Add the following block to the file:
<Connector protocol="HTTP/1.1" port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true" keystoreFile="conf\localhost.jks" keystorePass="password" clinetAuth="false" sslProtocol="TLS" />
Navigate to https://localhost:8443.
You should first see a certificate warning, click to bypass the warning.
You should now see Tomcat working over HTTPS
A full video tutorial can be found here: