Tomcat https and Tomcat https

Source: Internet
Author: User

Tomcat https and Tomcat https

1. Configure https one-way certificate authentication for Tomcat

Open tomcat's server. xml and find the <Connector port = "8443" node. The node should be commented out by default. uncomment and add the attribute:

KeystoreFile = "D: \ tomcat. jks"

Keystorepass= "123456"

 

The following describes how to create tomcat. jks:

Run the following commands at the Windows Command Prompt:

Cd % JAVA_HOME % \ bin

Keytool-genkeypair-keypass 123456-keyalg RSA-keystore D: \ tomcat. keystore-storepass 123456-dname "CN = localhost"

 

2. Configure https two-way certificate authentication for Tomcat

Open tomcat's server. xml and find the <Connector port = "8443" node. The node should be commented out by default. Cancel the comment,

Modify attributes:

ClientAuth = "true"

Add attributes:

KeystoreFile = "D: \ tomcat. jks"

Keystorepass= "123456"

TruststoreFile = "D: \ tomcat. jks"

TruststorePass = "123456"

 

The following describes how to create tomcat. jks:

Run the following commands at the Windows Command Prompt:

Cd % JAVA_HOME % \ bin

Keytool-genkeypair-alias tomcat-keypass 123456-keyalg RSA-keystore D: \ tomcat. jks-storepass 123456-dname "CN = localhost"

Keytool-genkeypair-alias mykey-keyalg RSA-storetype PKCS12-keystore D: \ mykey. p12-storepass 123456-dname "CN = demo"

Keytool-exportcert-alias mykey-keystore D: \ mykey. p12-storetype PKCS12-file D: \ mykey. cer-storepass 123456

Keytool-importcert-file D: \ mykey. cer-keystore D: \ tomcat. jks-storepass 123456

Enter the letter y to trust this certificate

Double-click D: \ mykey. p12 and the system prompts you to import the certificate to your computer.

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.