backport CertificateFailureError message fix

fixes #2318