严重的安全限制,而tomcat 8启动与liferay

abh*_*eet 7 security tomcat liferay liferay-6 tomcat8

当tomcat 8出现liferay时,我收到以下严重消息.

SEVERE [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/bg/c/portal/protected] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
03-Sep-2015 07:06:00.733 SEVERE [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/sv/c/portal/protected] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
03-Sep-2015 07:06:00.733 SEVERE [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/zh/c/portal/protected] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
Run Code Online (Sandbox Code Playgroud)

这对服务器启动没有任何影响,但不确定是什么原因引起的?任何帮助都会非常感激.

Kas*_*zaq 16

这意味着web.xml有人为模式上的POST和GET方法指定了一个安全约束/bg/c/portal/protected,可能与此类似:

<security-constraint>
    <web-resource-collection>
        <url-pattern>/bg/c/portal/protected</url-pattern>
        <http-method>POST</http-method>
        <http-method>GET</http-method>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>...</transport-guarantee>
    </user-data-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)

您应该删除http-method括号,以便它匹配所有方法url-pattern或创建第二个,如果您想在其上设置不同的安全约束而不使用任何http-method括号.

例如,如果您希望使用SSL /bg/c/portal/protected端点来保护POSTGET方法,但对于其他您不需要的,那么您应该创建如下配置:

<security-constraint>
    <web-resource-collection>
        <url-pattern>/bg/c/portal/protected</url-pattern>
        <http-method>POST</http-method>
        <http-method>GET</http-method>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>
<security-constraint>
    <web-resource-collection>
        <url-pattern>/bg/c/portal/protected</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)

如您所见,此模式的所有方法都被覆盖,因此不会抛出任何错误.