Tomcat全局/局部https访问配置方法
2016-06-06 16:49
531 查看
全局https访问
在Tomcat部署景安SSL证书后,如需要全局转换成https访问,解决办法如下:修改tomcat服务器的web.xml文件,在标记</webapp>前增加以下配置:
<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>
END
局部使用https访问
1如果是需要局部使用https访问,解决办法如下:这个会过滤api下的所有请求
<security-constraint>
<web-resource-collection>
<web-resource-name>SSL</web-resource-name>
<url-pattern>/api/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
2
这样配置,当访问路径包括test的时候,就会强制转换为https。
相关文章推荐
- HTTP get、post请求
- HTTP协议详解(真的很经典)
- wget https://www.baidu.com 报错ERROR: certificate common name `baidu.com' doesn't match requested host
- HTTP 状态代码
- HTTP 错误 500.21 - Internal Server Error PageHandlerFactory-Integrated
- HTTP 错误 500.21 - Internal Server Error PageHandlerFactory-Integrated
- TOMCAT HTTPS访问配置应用
- Http协议与TCP协议简单理解(转)
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class com.squareup.okhttp.C
- HTTP 头部信息和错误码汇总详细解释
- AFNetworking3.0网络请求
- 使用Volley加载网络图片
- 脉络清晰的BP神经网络
- BP神经网络的实现
- iOS-http请求出错App Transport Security Settings
- nodejs http.request 发送请求demo
- HttpClient 发送 HTTP、HTTPS 请求的简单封装
- 网络连接时套接字对的变化状态
- C# HttpClientHelper请求
- Fiddler学习_模拟网络限速+设置接口404+地址替换+修改返回数据