1
我發現下面的代碼片段添加到我的web.xml強制請求重定向到https:的Tomcat 7重定向到HTTPS VS web.xml中
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
這似乎是它應該做的工作,和我的應用程序重定向到https的請求就好了。
然而,網上建議建議在server.xml這樣做還有:
<Connector port="8080" enableLookups="false" redirectPort="8443" />
爲什麼我需要編輯server.xml?我的應用沒有它,但是,我有沒有打開的安全漏洞?這會在未來造成不可預見的問題嗎?