@asdsadw12312dwd2112xz/cert-check-cli
v1.0.0
Published
Check SSL/TLS certificates from the terminal
Readme
cert-check-cli
Check SSL/TLS certificates from the terminal.
Installation
npm install -g cert-check-cliOr run directly:
npx cert-check-cli example.comUsage
cert-check-cli [options] <domains...>Options
| Option | Description |
|--------|-------------|
| --json | Output results as JSON |
| --warn-days <n> | Exit with code 1 if cert expires within N days |
| --port <n> | Default port (default: 443) |
| --timeout <ms> | Connection timeout in ms (default: 10000) |
| -V, --version | Print version |
| -h, --help | Show help |
Examples
Check a single domain
cert-check-cli example.comOutput:
────────────────────────────────────────────────────────────
Domain: example.com
Status: ✓ VALID
Days left: 245 days
Valid from: Jan 1 00:00:00 2024 GMT
Valid to: Dec 31 23:59:59 2024 GMT
Subject: CN=example.com
Issuer: C=US, O=Let's Encrypt, CN=R3
SANs: example.com, www.example.com
TLS version: TLSv1.3
Cipher: TLS_AES_256_GCM_SHA384 (TLSv1.3)
────────────────────────────────────────────────────────────Check multiple domains
cert-check-cli github.com google.com cloudflare.comNon-standard port
cert-check-cli myserver.com:8443
# or
cert-check-cli myserver.com --port 8443JSON output
cert-check-cli example.com --jsonAlert mode (CI/monitoring)
Exit with code 1 if any cert expires within 14 days:
cert-check-cli example.com --warn-days 14
echo $? # 0 = ok, 1 = expiring or errorColor coding
- Green — valid, more than 30 days remaining
- Yellow — expiring within 30 days
- Red — expired
Build from source
npm install
npm run build
node dist/index.js example.com