Tomcat replaces HTTP with HTTPS

xiaoxiao2021-03-06  45

Tomcat replaces HTTP with HTTPS

1. First create a certificate KeyStore with a tool keytore with JDK

Java_home / bin / keytool -genkey -alias tomcat -keyalg rsa / -keystore / path / to / my / keystore

2. If you are JAVA Secure Socket Extensions (JSSE), Version 1.0.2 or Later, and JAVA_HAR, JNET.JAR, JAVA_HOME / JRE / LIB / EXT

If it is JDK1.4.x already there is already these packages.

3. Modify the server.xml file under the Tomcat directory, increase

& Lt; Connector classname = "org.apache.catalina.connector.http.httpConnector"

Port = "8443" MINPROCESSORS = "5" maxprocessors = "75"

Enablelookups = "True"

AcceptCount = "10" debug = "0" scheme = "https" secure = "true">

& Lt; factory classname = "org.apache.catalina.net.ssslserversocketFactory"

ClientAuth = "false" keystorefile = "/ path / to / my / keystore" keystorepass = "RUNWAY" protocol = "tls" />

& Lt; / connector>

The value of the keystorepass is the password entered when generating the keystore.

Restart Tomcat, you can use HTTPS.

转载请注明原文地址:https://www.9cbs.com/read-75575.html

New Post(0)