x509 certificate has expired or is not yet valid while the certificate is valid

Solution Verified - Updated -

Issue

  • The certificate check is failing, but the certificate configured in the server is currently valid.
  • The browser shows the site as "Not Secure".
  • The curl output shows the certificate is expired, but the certificate configured is valid:

    * TLSv1.3 (OUT), TLS alert, certificate expired (557):
    * SSL certificate problem: certificate has expired
    * Closing connection 0
    curl: (60) SSL certificate problem: certificate has expired
    
  • The oc login command shows an error similar to the following, but the API certificate is valid:

    The server is using an invalid certificate: x509: certificate has expired or is not yet valid: current time 2025-01-01T00:00:00Z is after 2024-12-31T23:59:59Z"
    
  • Only in some machines, there are x509: certificate signed by unknown authority errors.

Environment

  • Red Hat Enterprise Linux (RHEL)
  • Red Hat OpenShift Container Platform (RHOCP)
  • Certificates

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content