How do i redirect errors to my custom error page if it's not standart http errors?
I've set up apache with ssl to gain access to site trough https with client authentication(server and client have certificates signed by CA). Just in case if client dosen't have certificate I'll get standart error message from ssl:
Secure Connection Unsuccessful Error
But I have to redirect this error to my custom error page.
You cannot easily.
SSL errors happen in the TCP level meaning the bond does not become so terrible where it may be handled by Apache's standard error handling and rerouted to some custom error page.
There's a classic Apache module known as mod_ssl_error (http://marcstern.tripod.com/mod_ssl_error/) which does exactly what you would like, however it mandates that you patch and recompile mod_ssl.
An alternative choice is to setup two sites, one with SSLVerifyClient optional and the other with SSLVerifyClient require (http://www.modssl.org/paperwork/2.1/ssl_reference.html#ToC13). Direct your customers towards the first site and when the not compulsory connection works, forward these to the 2nd site. Otherwise show a mistake message. This will not assist you to understand why the bond did not work however it will show you something went wrong.
See https://issues.apache.org/bugzilla/show_bug.cgi?id=35083 for many additional particulars about this problem.