Local simulation Test opening process
HTTPS If the production environment is applied to the domain name, it is necessary to request the certificate directly or indirectly from the CA to obtain the trust of the browser. Let's first test this process in local simulations, generate the certificates ourselves, and then introduce the domain name to enable HTTPS.
①keytool Tool Generation Certificate
Open the Keytool directory that comes with the JDK.
Here's a brief introduction.
密钥库口令:123456(这个密码非常重要)名字与姓氏:192.168.0.110(以后访问的域名或IP地址,非常重要,证书和域名或IP绑定)组织单位名称:anything(随便填)组织名称:anything(随便填)城市:anything(随便填)省市自治区:anything(随便填)国家地区代码:anything(随便填)
② Application certificate to Tomcat
Open the Tomcat configuration file conf\server.xml .
Uncomment and add two properties keystoreFile keystorePass .
<connector port=" 8443 "protocol= "http/1.1" sslenabled= "true" Span class= "Hljs-attribute" >maxthreads= "scheme= "https" secure= "true" clientauth=" false "sslprotocol= "TLS" keystorefile= "E:/tomcat.keystore" Span class= "Hljs-attribute" >keystorepass= "123456"/>
Where Keystorefile is the certificate file address generated in the previous step, Keystorepass is the KeyStore password in the previous step.
Tomcat enables the HTTPS protocol configuration process