Using a one-way authentication method to configure Tomcat to be accessed in HTTPS mode

Source: Internet
Author: User
Tags port number tomcat

At the Command Prompt window, enter the Tomcat directory and execute the following command:

Keytool-genkey-alias tomcat-keyalg rsa-keypass changeit-storepass changeit-keystore server.keystore-validity 3600

Keytool-genkey-alias tomcat-keyalg rsa-keypass changeit-storepass changeit-keystore server.keystore-validity 3600

Generate the Server.keystore certificate file by using the steps above,

Turn on the servlet.xml comment (preferably copy this section)

<!--Define a SSL http/1.1 Connector on port 8443--> <connector protocol= 

            "Org.apache.coyote.http11.Http11P Rotocol "port=" 8443 "maxhttpheadersize=" 8192 "maxthreads=" "Minsparethrea" 

            ds= "maxsparethreads=" 

            enablelookups= "false" disableuploadtimeout= "true" 

            Acceptcou           Nt= "Scheme=" "https" secure= "true" 

            clientauth= "false" sslprotocol= "TLS" 

            Keystorefile= "Server.keystore" 

            keystorepass= "Changeit"/>

Go to this step to access Https;//ip:8443/item

The general Tomcat default SSL port number is 8443, but for the SSL standard port number is 443, so you can access the Web page directly using HTTPS without the need for the input port number, such as http://www.bianceng.cn

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.