美文网首页
Tomcat配置SSL支持https并强制https访问

Tomcat配置SSL支持https并强制https访问

作者: 我本佛山人 | 来源:发表于2017-08-29 20:30 被阅读0次
image.png

1、在阿里云上支持免费版的CA证书
https://common-buy.aliyun.com/?spm=5176.2020520163.cas.1.4272e7a9R0JOhX&commodityCode=cas#/buy

2、配置Tomcat
https://yundun.console.aliyun.com/?spm=5176.2020520163.1002.d10cas.4272e7a9ZkAjDt&p=cas#/cas/download/214242079920956

3、强制以https方式访问
在tomcat\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>

相关文章

网友评论

      本文标题:Tomcat配置SSL支持https并强制https访问

      本文链接:https://www.haomeiwen.com/subject/tteadxtx.html