Configure the SSL certificate to allow the tomcat server to accept HTTPS requests

1: Apply for an SSL certificate

https://yundun.console.aliyun.com/

 

2: Install win openssl

http://slproweb.com/products/Win32OpenSSL.html

Configure the PATH environment variable to execute openssl on the command line

 

3: Generate pfx certificate

 3.1: Put the applied certificate under: Tomcat 8.0\cert

 3.2: Execute the command to generate the PXF certificate on the Tomcat 8.0\cert command line:

openssl pkcs12 -export -out certificate name.pfx -inkey 214178273810125.key -in 214178273810125.pem

 

4: Configure the server.xml of TOMCAT

 

<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"

               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"

               clientAuth="false" sslProtocol="TLS" keystoreFile="cert/证书名称.pfx"  

  keystoreType="PKCS12"

  keystorePass="123456"/

Notice:

1: The port is set to 443, the default HTTPS port, which can be used without adding the port number when requesting HTTPS.

2: keystoreFile is the certificate path

3: keystoreType is the certificate type, PFX is fixed to PKCS12

4: keystorePass is the certificate password (the password entered when generating the certificate)

5: clientAuth is set to FALSE (two-way authentication is not enabled, two-way authentication is enabled, and the client needs to install a certificate)

6: Protocol is set to org.apache.coyote.http11.Http11NioProtocol

7: Other items can be modified as required.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326310735&siteId=291194637