Tomcat Configuration HTTPS protocol
1. Locate the bin directory under the local JDK, there is a file Keytool.exe under the Bin directory (in the Bin directory space, hold down SHIFT right-click, open the Command window, for example)
2. In the cmd Command window, enter the command (keytool -genkeypair -alias "Tomcat" -keyalg "RSA" -keystore "D : \tomcat.keystore " )
Follow the prompts to enter:
KeyStore Password : 123456 (This password is very important)
First and last name : 192168. 1. 119 (Domain name or IP address to be accessed later, very important, certificate and domain name or IP binding)
Organizational unit name : anything (optional)
Organization Name : anything (optional)
City : Anything (fill in)
Provinces and municipalities : anything (optional)
Country Area code : Anything (fill in)
After all the input is finished, a Tomcat.keystore file is generated under the D disk according to your command, which is the file we need
At this time, we need to open our Tomcat configuration file server.xml This file, to configure HTTPS (file under tomcat/conf)
1. Note <listener classname= "Org.apache.catalina.core.AprLifecycleListener" sslengine= "on"/>
2. Uncomment the line and add two properties keystoreFile
keystorePass
.
After all, restart Tomcat, we can use the other HTTPS access to our own IP, such as the HTTPS://192.168.1.119:8443/project, the port number is set above the 8443, not the original project of 8080
Tomcat Configuration HTTPS protocol