1. First, use the built-in JDK tool keytool to generate a "server certificate"
Java_home/bin/keytool-genkey-alias tomcat-keyalg RSA-keystore C:/tomcat. Key
Enter the password. Use the default value of changeit in Tomcat.
Enter relevant information and confirm
Generate a digital certificate in pcks1.2 format in C:/tomcat. Key
2. if jdk1.3 or below, you need to download the Java securesocket extensions (JSSE) package (http://java.sun.com/products/jsse/), version 1.0.2or later, and. jar, jnet. jar, JSSE. copy jar to $ java_home/JRE/lib/EXT
If it is jdk1.4.x +, these packages are already available.
3. Modify the server. xml file in the Tomcat directory and add
<Connector Port = "8443" maxhttpheadersize = "8192"
Maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" disableuploadtimeout = "true"
Acceptcount = "100" Scheme = "HTTPS" secure = "true"
Clientauth = "false" keystorefile = "C:/tomcat. Key"
Keystorepass = "changeit" sslprotocol = "TLS"/>
4. Restart Tomcat and access https: // localhost: 8443/