Java Web encryption will apply a method of switching from HTTP to HTTPS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.