In SSL settings of my web site (which is a non-public ASP.NET MVC 3 app) I checked "Require SSL". For Client certificates I selected the option "Require". When a user opens my site, a browser (e.g. Chrome) asks to pick any available certificate. If the user just presses Cancel button, IIS 7.5 shows a standard error page:
HTTP Error 403.7 - Forbidden The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) client certificate that the Web server recognizes.
I can show my custom 403.7 error page via httpErrors section in Web.config, but this static page is not sufficient for my purpose. I would like to process this error manually, analyse the reason (is the certificate chosen or it is chosen but outdated) and show for users an appropriate message about what is wrong and what to do. Can I write a module that process this error? I tried a managed module, but the error occurs before the module's initialization. Can a native module intercept this error?