SSL/TLS certificates underpin secure web browsing and data transfers, but it’s crucial to keep track of their expiration dates. Windows offers a few ways to check this information directly from the command line. Here’s a breakdown of the methods:
1. Using the ‘certutil’ Command
The certutil command-line utility is designed for managing certificates in Windows. Here’s how to use it:
- Find the Certificate: If you have a local certificate file (.cer, .crt), locate it.
- Open Command Prompt: Type ‘cmd’ into the Windows search bar and open the Command Prompt.
- Run the command: Bash
certutil -verify -urlfetch certificate.cerReplacecertificate.cerwith the name of your certificate file. - Locate “Not After”: The output contains a line indicating the expiration date (“Not After”).
2. Remote Website Certificate with OpenSSL
While not built-in to Windows, OpenSSL is a popular tool that can be downloaded and used for certificate checks.
- Download OpenSSL: If you don’t have it, download the Windows binary from a reputable source (e.g., https://slproweb.com/products/Win32OpenSSL.html)
- Open Command Prompt:
- Run the command: Bash
openssl s_client -connect www.example.com:443 < /dev/null | openssl x509 -noout -datesReplacewww.example.comwith the domain you want to check. Look for the “notAfter” field in the output.
Important Considerations
- Local vs. Remote: The first method is geared toward locally stored certificate files, while the second inspects certificates on remote websites.
- OpenSSL Installation: The OpenSSL method requires you to download and install OpenSSL for Windows.
Additional Tips
- PowerShell: If you’re comfortable with PowerShell, it also offers ways to examine certificates.
- Certificate Store You can view certificates installed in your Windows Certificate Store graphically using the Certificate Manager (
certmgr.msc).
In Summary
Knowing how to check SSL certificate expiration dates in Windows command line aids with timely renewals, ensuring the security and smooth functionality of your systems.
Read also:
- Master OpenSSL Commands for Certificate and Key Management
- How to Check SSL Certificate Expiration Date in Linux
- Guide To Check Certificate Expiration Dates with OpenSSL
- How to Check PEM Certificate Expiration Date in Linux
- How to Check SSL Certificate Expiration Date in Ubuntu
- Shell Scripting for Proactive Certificate Expiration Monitoring