i’ve got a virtual server listening on 443 which uses both a certificate for SSL and also requires client authentication. this works fine
i’ve now been informed of another set of users who want to access the same site but don’t want to have to authenticate (although they still want their sessions to be encrypted using SSL)
is there a way of making use of the same virtual server with an irule which determines from the uri whether or not they need to authenticate?
I’m working on an iRule which does this and a bit more. Maybe when I finish testing it I can post it to the Codeshare.
In the meantime, if you want to selectively request or require a client cert, you’ll need to set the SSL profile client cert option to none and then use an iRule to check the requested URI and renegotiate the SSL handshake using SSL::renegotiate for specific URIs. The SSL::renegotiate wiki page has a very simplified example (Click here).
would something like this do the trick? the clients would eventually go on to the same back end pool, don’t know if i could just reference it once at the bottom?
why do you have to specify the SSL:: options? won’t these be picked up in the actual client ssl profile that already exists? if not, why don’t you need to specify the actual CA and CRL in the irule?
The clientssl profile you add to the virtual server should have client cert set to ignore and then the iRule dynamically requests (or requires) a client cert for specific URIs using the SSL:: commands.
If you set the cert mode to require, a client who doesn’t send a cert when it’s prompted will receive a TCP reset. If you want to handle this more gracefully, you could set the profile to request and then have the app send a response if no cert is present.
You’ll probably want to insert the client cert in the session table and include some details about the cert in the HTTP headers in requests to the pool. This way the pool member can validate the cert before allowing the request. This could also be done in the iRule using the clientssl profile’s Trusted CA cert field and the SSL::verify command.
i guess it’s saying, if the client offers a certificate then release the data. but according to the wiki, the CLIENTSSL_HANDSHAKE is triggered when a client-side SSL handshake has actually been completed
in addition, i don’t know why this is required and what effect it has on the second part of the irule?
CLIENTSSL_HANDSHAKE is triggered when the clientside SSL handshake is completed. SSL::cert count returns the number of client certs in the request. If there is one or more certs, then the HTTP held from when HTTP::collect was called is released and the request continues.
You could add logic in CLIENTSSL_HANDSHAKE to check for clients making a request with no cert after the renegotiation. You could also validate the client cert against either the SSL cert in the client SSL profile or using a trusted CA cert. You can use the SSL::verify_result (Click here). You’d probably also want to check the AUTH::status value in AUTH_RESULT to see whether the OCSP validation was completed successfully.
Note there is an issue where you can’t differentiate between no response and a revoked status from the OCSP responder using AUTH::status. F5 is tracking this in CR126501. A workaround is to create a pool containing the OCSP server IP address(es) and then use a monitor to check the status of the pool. You can then use [active_members $ocsp_pool] in your iRule to detect whether the OCSP servers are down.
I have created a new virtual servers, on vip, it shows dns name. I’m using following command from putty. [root@OA-PP-LB2:Standby] config domaintool --debug --join --admin_principal admin --host
DC can do forward and reverse lookup on DNS. Any assistance in this situation will be appreciated. What settings you have in your working v.ip.