]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Improved error message for X509_V_ERR_CERT_NOT_YET_VALID
authorLuke Kurlandski <44705759+lkurlandski@users.noreply.github.com>
Tue, 4 Mar 2025 16:53:36 +0000 (11:53 -0500)
committerTomas Mraz <tomas@openssl.org>
Thu, 24 Apr 2025 12:37:39 +0000 (14:37 +0200)
In addition to an invalid certificate, it is not unlikely that this
exact error (case X509_V_ERR_CERT_NOT_YET_VALID) is caused by an
incorrect system clock. This cannot be trivially fixed, so for now,
we simply improve the quality of the error message.

Fixes #14771

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27141)

crypto/x509/x509_txt.c

index e825ce2db8b987be0a264c6ba275f5b5111d5ead..edbf5bdbb1fa4178e9164b461de03f3109085d6f 100644 (file)
@@ -40,7 +40,7 @@ const char *X509_verify_cert_error_string(long n)
     case X509_V_ERR_CRL_SIGNATURE_FAILURE:
         return "CRL signature failure";
     case X509_V_ERR_CERT_NOT_YET_VALID:
-        return "certificate is not yet valid";
+        return "certificate is not yet valid or the system clock is incorrect";
     case X509_V_ERR_CERT_HAS_EXPIRED:
         return "certificate has expired";
     case X509_V_ERR_CRL_NOT_YET_VALID: