Wouldn't it be better to raise an Exception if the certificate is invalid?