- 修改conf下server.xml配置文件
搜索https,在注释的下方增加下面代码
keystoreFile:密钥路径
keystorePass:密码
<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
enableLookups="false"
acceptCount="100" disableUploadTimeout="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="C:\apache-tomcat-8.0.30-yihe\conf\mp.memoriesbox.cn.jks"
keystorePass="34q2a8z0c8lt" />
- 修改redirectPort为443
<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="443"/>
- 修改redirectPort为443
<Connector port="7002" protocol="AJP/1.3" redirectPort="443"/>
- 修改conf下web.xml配置文件
找到<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>