Tomcat doesn't provide selective-mutual-authentication for different paths, but if you only need to have such selective-mutual-authentication apply at the webapp-level (and not inside of a particular web application), you might be able to get away with having a separate <Connector>
for a special web application. This requires a separate <Service>
and therefore <Host>
, and of course a different port number (unless you happen to have a separate network interface you can use to preserve ports).
I haven't tried it, but I would imagine that, theoretically, SNI+client-auth could be configured so that a particular hostname would have different client-authentication requirements, but there is no such code in Tomcat to support that currently.
Tomcat can be configured to use a different trust store and a different certificateVerification
setting per hostname, but it doesn't allow you to change it per path.
Another option would be to configure Tomcat to "want" (or even require) a client cert, and then perform the checking yourself using a Filter
. Filter
s can be applied on a per-path basis, plus your application becomes more portable because you aren't relying on some feature that may be Tomcat-specific.
Have a look at this thread for how I did this a few years ago. There is (eventually) some sample code plus lots of references for how I got all the information to put it together: http://markmail.org/thread/vxwwli5nzt4itfr2