[英]disable https on localhost only
我正在使用 tomcat 7,我只想禁用来自本地主机的 SSL 流量! 并为入站流量启用它。
我已将以下配置添加到web.xml
,它目前将流量从 http 重定向到 https。
<security-constraint>
<web-resource-collection>
<web-resource-name>app</web-resource-name>
<url-pattern>/info</url-pattern>
</web-resource-collection>
<!-- OMIT auth-constraint -->
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>app</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Role</role-name>
</auth-constraint>
</security-constraint>
我的服务器上有一个自定义备份工具,它不适用于 HTTP,因此我希望在 localhost 上禁用 HTPP。
你可以在你的 server.xml 文件中评论下面的行。
<Connector port="8443" ... SSLEnabled="true" scheme="https" secure="true" sslProtocol="TLS" ... />
希望这会有所帮助!
您可以禁用特定的 url,只需将 NONE 放在传输保证标签上,检查Tomcat 的安全约束配置是否是强制性的?
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>securedapp</web-resource-name>
<url-pattern>/info/*</url-pattern>
<url-pattern>/info2/*</url-pattern>
<url-pattern>/info3/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.