1、配置
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" /> <Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="cert/xxx.jks" keystorePass="xxxxx"/> <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
密码设置成一样的,省心;
2、在tomcat 下mkdir cert,在cert下根据命令创建jks:
keytool -importkeystore -srckeystore 2#############951.pfx -destkeystore sslkey.jks -srcstoretype PKCS12 -deststoretype JKS
3、开启443防火墙;
4、conf 下的web.xml配置
<welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <login-config> <!-- Authorization setting for SSL --> <auth-method>CLIENT-CERT</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <security-constraint> <!-- Authorization setting for SSL --> <web-resource-collection > <web-resource-name >SSL</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
*******************************现在用的下面的*********************************
1、下载tomcat的证书,解压;
2、上传到Tomcat根目录下的cert文件夹
3、配置server.xml
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" URIEncoding="UTF-8" useBodyEncodingForURI="true"/> <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="cert/2075587_beicaiduo.com.pfx" certificateKeystorePassword="VV5OflnA" certificateKeystoreType="PKCS12" /> </SSLHostConfig> </Connector> <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
4、防火墙,阿里云的安全配置
5、重启完事