I have an Apache HTTP Server with SSL enabled and requesting a Client Certificate.
How do I set up Apache to only request the certificate when a user hits a certain part of the website?
Example:
/myapp/ should not request the cert
/myapp2/ should request the cert
Note: These applications are being served using the mod-jk
Someting like this should do the magic:
More info about SSLVerifyClient directive here.
The trick here is that you need to do this in tomcat. Since that is what is actually proccessing the request.
Since client auth is on a per connector basis you'll need to create 2 new connectors. One for the base SSL w/ auth, and one for the mod_jk connector (chosen ports arbitrarily chosen as cur+1).
Then just setup a secondary mod_jk worker to connect to the client auth SSL in apache for /myapp2
This might work: http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html#arbitraryclients
How can I authenticate my clients for a particular URL based on certificates but still allow arbitrary clients to access the remaining parts of the server?
For this we again use the per-directory reconfiguration feature of mod_ssl: httpd.conf