How can I redirect errors to my custom error page if it is not standart http errors?
Example:
I have configured apache with ssl to access web site trough https with client authentication(server and client have certificates signed by CA). In case if client dosen’t have certificate I’ll get standart error message from ssl:
Secure Connection Failed Error
code: ssl_error_handshake_failure_alert
But I need to redirect this error to my custom error page.
How can I redirect errors to my custom error page if it is not
Share
You can’t easily.
SSL errors happen at the TCP level which means the connection doesn’t get to the point where it can be handled by Apache’s standard error handling and redirected to a custom error page.
There is an old Apache module called mod_ssl_error (http://marcstern.tripod.com/mod_ssl_error/) which does exactly what you want, but it requires that you patch and recompile mod_ssl.
Another option is to set up two sites, one with SSLVerifyClient optional and another with SSLVerifyClient require (http://www.modssl.org/docs/2.1/ssl_reference.html#ToC13). Direct your users to the first site and if the optional connection works, forward them to the second site. Otherwise show an error message. This won’t help you figure out why the connection didn’t work but it will let you know something went wrong.
See https://issues.apache.org/bugzilla/show_bug.cgi?id=35083 for some additional details on this problem.