raise appropriate error when openSSL cannot verify cert