Error Codes Wiki

Linux SSL/TLS Certificate Errors — Expired, Self-Signed & Chain Issues

Warningsecurity

Overview

Fix Linux SSL/TLS errors including certificate expired, unable to verify certificate chain, self-signed certificate rejection, and CA bundle configuration.

Key Details

  • Certificate errors from curl, wget, git, and other tools indicate TLS verification failure
  • Common: 'SSL certificate problem: unable to get local issuer certificate'
  • CA certificates are stored in /etc/ssl/certs/ or /etc/pki/tls/certs/ depending on distro
  • Let's Encrypt certificates require the ISRG Root X1 CA in the trust store
  • Self-signed certificates are rejected by default — must be explicitly trusted

Common Causes

  • System CA certificate bundle outdated (missing newer CAs)
  • Clock significantly wrong causing valid certificates to appear expired
  • Corporate proxy with MITM certificate not in the trust store
  • Self-signed certificate used on server
  • Intermediate certificate missing from server configuration (incomplete chain)

Steps

  1. 1Update CA certificates: sudo apt install --reinstall ca-certificates (Debian/Ubuntu) or sudo yum reinstall ca-certificates (RHEL)
  2. 2Check system time: date — fix with: sudo timedatectl set-ntp true
  3. 3Test certificate: openssl s_client -connect hostname:443 -showcerts
  4. 4Add custom CA: copy cert to /usr/local/share/ca-certificates/ then sudo update-ca-certificates
  5. 5For curl specifically: curl --cacert /path/to/ca-bundle.crt URL

Tags

linuxssltlscertificateca

More in Security

Frequently Asked Questions

Only for testing. Never in production. Fix the root cause: update CA certs, fix clock, or add the correct CA to your trust store.