Ssl Certificate Expiry avatar

Ssl Certificate Expiry

Pricing

$0.01 / actor start

Go to Apify Store
Ssl Certificate Expiry

Ssl Certificate Expiry

Pricing

$0.01 / actor start

Rating

0.0

(0)

Developer

Eichan Jolly

Eichan Jolly

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Features

Limited permissions

Share

Bulk TLS Certificate Expiry Checker

Small scheduled job: Check the TLS certificate on port 443 for 1–20 HTTPS hostnames, show who issued it and when it is valid, and sort the results by expiry urgency (expired first, then shortest remaining validity; errors last).

Who is it for?

Site owners, small web operations teams, and agencies keeping track of certificate renewal deadlines across multiple public HTTPS hosts. Unlike a deep single-host TLS diagnostic, this is a bulk, expiry-first snapshot.

Example input

{
"hostnames": ["example.com"]
}

Supply one to twenty bare hostnames (example.com, www.example.com), with no https://, trailing path, port, credentials, or IP address. The Store input is prefilled with a public site for which certificate information is publicly observable.

Example output: one certificate

The following is illustrative (expiry depends on live certificate rotation and run time).

{
"hostname": "example.com",
"issuer": "organizationName=Example Certificate Authority, commonName=Example TLS CA",
"subject": "commonName=example.com",
"notBefore": "2026-09-26T00:00:00Z",
"notAfter": "2026-12-25T00:00:00Z",
"daysRemaining": 54,
"status": "ok",
"error": null,
"checkedAt": "2026-11-01T12:00:00Z"
}

Fields: issuer and subject are human-readable certificate distinguished names; notBefore/notAfter are UTC ISO 8601; daysRemaining is a signed integer (rounded up for positive partial days, down after expiry); status is ok, expiring_soon (time left is at most 30 × 24 hours), expired, or error. Every hostname produces one row. Error rows contain a plain-language error and null certificate data; errors sort last.

Running locally

Python 3.12+ only, no external dependencies:

export ACTOR_INPUT_JSON='{"hostnames":["example.com","www.example.com"]}'
python src/main.py

Local dataset records are created at ./storage/datasets/default/. Alternatively supply ./storage/key_value_stores/default/INPUT.json.

On Apify, input priority is: ACTOR_INPUT_JSON if supplied; otherwise GET https://api.apify.com/v2/key-value-stores/{APIFY_DEFAULT_KEY_VALUE_STORE_ID}/records/INPUT with the run's APIFY_TOKEN; otherwise local JSON. The default dataset is written via Apify's REST API. No Apify SDK, external key, or source-site login is required.

Limits & honest behavior

  • Checks TLS on port 443 only; does not request HTTP pages, scan other ports, or evaluate full security configuration. Public hostnames only; private/local hostnames and IP literals are rejected.
  • Uses the Python standard-library ssl and socket, validates certificate trust and hostname on normal connections, and sends the hostname via SNI. For an expired certificate, verification normally fails; the Actor retries an unverified connection only to read its expiry metadata. An untrusted or wrong-host certificate that has not expired is an error, not ok.
  • CPython's internal standard-library _test_decode_cert helper is used only for that expired-certificate fallback. Other Python implementations may not support this limited fallback.
  • Timeout is 6 seconds per resolved address; resolution and connection failures are reported individually. A successful certificate check is a snapshot of the server reached during this run, not a renewal guarantee.
  • daysRemaining uses UTC instants, not calendar-date differences; a just-expired certificate reports -1. Hostnames may resolve to multiple public IPs: the first reachable address is checked, not every load-balanced certificate.
  • This Actor does not email alerts, remember previous runs, or replace comprehensive certificate-chain auditing. The dataset is sorted to put the most urgent dates first, with errors last.

Scheduled use case

Schedule once daily for up to twenty managed domains. Have a downstream workflow inspect status == "expiring_soon" or status == "expired" and contact the domain owner. No alerts are sent by this Actor itself.

Store information

Categories: Automation (AUTOMATION), Developer Tools (DEVELOPER_TOOLS). Suggested pricing: $0.010 per run (advisory only; no billing configured).