keytool -genkey -keystore "D:\localhost.keystore" -alias localhost -keyalg RSA
在D盘生成localhost.keystore文件
tomcat server.xml添加
<Connector port="9999" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="E:\localhost.keystore" keystorePass="123456789"/>
将原来的http,ajp的redirectPort设定成9999
在tomcat的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>
实现自动跳转
tomcat https设置
猜你喜欢
转载自xl822786603.iteye.com/blog/2347068
今日推荐
周排行