Tomcat - 仅在某些页面上请求CLIENT-CERT,但在所有页面中都需要SSL

时间:2015-09-21 15:31:42

标签: tomcat ssl client-certificates

我目前正在使用其web.xml上的以下安全限制在我的网络应用上强制使用SSL:

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Protected Context</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

现在我已经实现了客户端证书登录,我添加了

<login-config>
    <auth-method>CLIENT-CERT</auth-method>
</login-config>

这允许我从Web应用程序检索客户端证书并使用它来登录客户端。

但是有些公共页面不需要身份验证,我希望强制使用SSL(这是一个官方网站,所以不管你看到它发布在哪里,私有与否,最好让CA验证服务器证书)。

简而言之:我不希望tomcat为这些公共页面请求客户端证书,但我想在私有页面上请求它。如何设置我的web.xml / server.xml配置以允许此操作?

0 个答案:

没有答案
相关问题