Security & Auth Error
Fix "Error: certificate has expired / CERT_HAS_EXPIRED" in Node.js & cURL
Developer guide and instant terminal command to diagnose and solve this error.
Terminal Output
$Error: certificate has expired (CERT_HAS_EXPIRED)
Why Does This Error Happen?
The SSL/TLS certificate of the destination server has passed its validity expiration date, or your system clock is out of sync.
Instant Terminal One-Liner Fixes
Linux (Bash / Zsh)
echo | openssl s_client -servername domain.com -connect domain.com:443 2>/dev/null | openssl x509 -noout -dates
macOS (Terminal / iTerm2)
echo | openssl s_client -servername domain.com -connect domain.com:443 2>/dev/null | openssl x509 -noout -dates
Windows (PowerShell Run as Administrator)
openssl s_client -connect domain.com:443
Comprehensive Step-by-Step Resolution
- 1Verify system time is correct: NTP clock drift often causes false SSL expiration.
- 2Check the remote certificate expiry using OpenSSL.
- 3Renew the certificate on the target server with Certbot / Let's Encrypt.
Dedicated Companion Tool
Open ToolTroubleshoot using the SSL Certificate Expiration Checker
Use our client-side utility with zero server upload for instant debugging.
Frequently Asked Questions
Frequently Asked Questions
Frequently Asked Questions
Everything you need to know regarding specifications, syntax, and security best practices.
The SSL/TLS certificate of the destination server has passed its validity expiration date, or your system clock is out of sync.