Fixed issue where x509 certificate validation threw a 500 server error on failure. Fixes #31