在https的tomcat环境中,使某些特殊的资源通过http来访问

来源:互联网 发布:apache 微服务 框架 编辑:程序博客网 时间:2024/06/06 00:52

项目的背景
该系统是一个基于https访问的后台管理系统,客户提出开发一些webservice,来请求一些定制的服务,要求访问方式为http。
后来经过各种资料的查询,目前得出以下方案。

<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>**<!-- 当系统访问webservice开头的资源的时候,不遵守https协议 -->**<security-constraint>    <web-resource-collection>        <url-pattern>/webservice/*</url-pattern>    </web-resource-collection></security-constraint>

最后一个security-constraint是我加上的,我只是设置了资源但是没有设置资源的访问或者保护方式。

在security-constraint配置中,auth-constraint标识何种角色何种人才能访问资源。
user-data-constraint 在传输层进行保护。

所以以上即可满足要求。

具体参考:http://blog.csdn.net/lisheng19870305/article/details/40819481

0 0
原创粉丝点击