Transferred from: supersky07 (http://my.csdn.net/supersky07) blog (with some changes)
I searched on the Internet, but the content was not perfect. Now, make Study Notes for future use.
(1) Go to the bin directory under JDK.
(2) input the following command "keytool-v-genkey-alias tomcat-keyalg RSA-keystore D:/tomcat. keystore"
D:/tomcat. keystore stores the generated tomcat. keystore in the root directory of drive D. Note: If you want to store the data on the C drive, you must enter the command line as an administrator in Windows 7. Otherwise, you cannot create tomcat. keystore. In this example, put it on disk D.
How can I access the command line as an administrator? Start-> Enter cmd in the search box-> wait (note not to press Enter)-> Find "cmd.exe"-> right-click "Run as administrator.
(3) enter the keystore Password
The password is arbitrary. Here we use 123456 as an example. Remember this password and then use it for server. xml configuration.
(4) enter the name, organization, organization, city, province, and country information
(5) A confirmation prompt will appear after the input.
Enter y and press Enter. The keystore is created.
Go to the root directory of disk D and you will see the generated tomcat. keystore.
(6) enter the Tomcat master password
You can press enter directly. The default value is the same as the keystore password.
The storage is complete.
(7) enter the Tomcat folder
Locate Sever. XML in the conf directory and edit it.
Comment out all ctor ins starting with <connector Port = "8443. (Note: According to my actual test, all ctor ers need to be noted here)
(8) Add the code for loading the keystore in sever. xml.
Note that the keystore password in the box is the "123456" we just set ".
Close and save Sever. xml after editing.
(9) start Tomcat.
If the following error occurs: "keystore was tampered with, or password was incorrect", the password set in step (8) is incorrect. Check the password and re-compile Sever. xml.
(10) Use https: // localhost: 8443 to access the page
If the page is successfully opened, the HTTPS configuration under Tomcat is successful.
Because the certificate used in the above configuration process is manually generated by the user without third-party authentication, the browser will prompt that the certificate is risky, but it can still be accessed. (For example)