Thanks for the article http://blog.csdn.net/zhangzuomian/article/details/50324395
But it's not tested, just record it.
Roughly 2 steps: 1, obtain the certificate. 2. Modify Tomcat's Config/server.xml and Project Web. XML configuration
Open Config/server.xml, uncomment the following 8443-port code, and modify the following:
<connector port= "8443" protocol= "http/1.1" sslenabled= "true" maxthreads= "" scheme= "https" secure= "true" clientauth= "false" keystorefile= "D:/appserver/tomcat/apache-tomcat-6.0.32/conf/tomcat.keystore" keystorepass= "Deleiguo" sslprotocol= "TLS"/>
Note:
Keystorefile: The location of the certificate file, Keystorepass is the KeyStore password (you will have keystore password and tomcat master password when you generate the certificate)
The Project Web. XML is added as follows:,
<security-constraint> <web-resource-collection> <web-resource-name>ssl</ web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </ User-data-constraint> </security-constraint>
Reprinted from http://blog.csdn.net/rainyspring4540/article/details/68925073
Java Web encryption will apply a method of switching from HTTP to HTTPS