TOMCAT7 Configuring HTTPS security access

Source: Internet
Author: User

Configuring HTTPS in Apache-tomcat-7.0.33-windows-x64.zip results in some problems when configuring SSL

1. Generate the private key and self-issued certificate with the Keytool from the JDK, as follows:

Keytool-genkey-alias Sdtx-keyalg Rsa-keystore D:/keys/sdtx.keystore

2. Enable Web server (TOMCAT) SSL, which is the HTTPS encryption protocol, ready for a clean tomcat, this tutorial uses the apache-tomcat-7.0.33-windows-x64 to open the Tomcat directory of conf/ Server.xml file, open comment code for lines 83 and 87, and set Keystorefile, keystorepass Modify the result as follows:

<ConnectorPort= "8443"Protocol= "Org.apache.coyote.http11.Http11Protocol"MaxThreads= "Max"sslenabled= "true"Scheme= "https"Secure= "true"ClientAuth= "false"Sslprotocol= "TLS"Keystorefile= "D:/test/sdtx.keystore"Keystorepass= "123456"/>

3. How to configure the Java Web program to use HTTPS

If you want your Java EE Web program to use the HTTPS protocol for SSL communication, you need to add the following in the Web. XML configuration file:

<Security-constraint>      <web-resource-collection>        <Web-resource-name>App</Web-resource-name>        <Url-pattern>/*</Url-pattern>      </web-resource-collection>      <User-data-constraint>        <Transport-guarantee>Confidential</Transport-guarantee>      </User-data-constraint>    </Security-constraint>

TOMCAT7 Configuring HTTPS security access

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.