1
添加https對tomcat的支持後。我不能運行該應用程序Tomcat安全約束不起作用
我的web.xml配置
<display-name>EBaySignin</display-name>
<welcome-file-list>
<welcome-file>credentials.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>All Access</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
(Tomcat)的server.xml中配置:
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<Connector port="8443" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="/Users/ArunAbraham/.keystore" keystorePass="password"
protocol="org.apache.coyote.http11.Http11NioProtocol"
clientAuth="false" sslProtocol="TLS" />
現在我已經無法訪問應用程序,我收到一個錯誤:無法連接到服務器。我可能會錯過什麼? ("https://localhost:8443/EBaySignin/")
我沒有檢查聲明,SSL工作正常。但是,一旦我添加聲明,這些應用程序都不起作用。即使是非安全的人也不會工作。它只是給了HTTP 404錯誤。 –
2013-02-25 01:09:28
我能夠訪問此https:// localhost:8443,但我無法訪問該Web應用程序,我收到服務器未找到錯誤(404)。 – 2013-02-25 01:24:14
好的,所以SSL不是問題。所以現在到了安全限制。再次檢查如何實現的基本文檔,但檢查「web.xml」中條件的URL模式,並且如果使用基於角色的安全性,則安全角色名稱與設置的內容匹配在接收方。請記住,元素阻止未經授權的用戶進入應用程序,因此他們必須被授權(用戶/密碼),他們的角色,檢查等。 –
2013-02-25 01:42:12