一、证书生成
传送门:http://ln-ydc.iteye.com/blog/1335213
二、tomcat 配置
注意: keystoreFile 路径改成自己第一步生成证书存放的路径,keystorePass 为自己配置的密码
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="C:/keystore.jks"
keystorePass="123456" />
三、web.xml 配置
<security-constraint>
<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>