[英]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.