# SSL Certificate Expiry Checker: Soonest First (`ucchiii/ssl-certificate-checker`) Actor

Check SSL/TLS certificates for a list of domains and get one row per host, soonest expiry first: days left, expiry date, issuer, SAN names, hostname match, chain validity, TLS version. Expired, self-signed and wrong-host certificates are still read. Optional filter: expiring within N days.

- **URL**: https://apify.com/ucchiii/ssl-certificate-checker.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 checked certificates

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**SSL certificate expiry checker for a list of domains, soonest expiry first**

**Paste your domains, press Start, and get one row per host sorted by expiry date: the certificates that run out first are at the top.** Each row has days to expiry, the expiry date, the issuer, the names the certificate covers, whether the hostname matches and whether the chain is trusted. Expired, self-signed and wrong-host certificates are read too, so you see exactly what is broken instead of a bare "handshake failed".

| host | daysToExpiry | expiresAt | chainValid | hostnameMatches | issuer | verifyError |
|---|---|---|---|---|---|---|
| expired.example.net | -12 | 2026-10-25T23:59:59Z | false | true | Example CA Inc | certificate has expired |
| shop.example.com | 9 | 2026-11-15T12:00:00Z | true | true | Let's Encrypt |  |
| test.example.org | 41 | 2026-12-17T08:30:00Z | false | true | test.example.org | self-signed certificate |
| www.example.com | 203 | 2027-05-28T23:59:59Z | true | false | DigiCert Inc |  |

(Illustrative values that show the shape of the rows; the full row has more fields, see Output.)

**Try it free:** leave the host list empty and press **Start** — five sample hosts are checked (not charged, rows carry `_demo: true`). The prefilled example checks 3 hosts for under 1 cent.

- **Soonest first:** expired certificates first, then the next to expire. Hosts that could not be checked come last.
- **Only what needs attention:** set **Only certificates expiring within (days)** to 30 and get just the certificates that expire in the next 30 days (plus already expired ones and failures).
- **Reads broken certificates:** the certificate is read without trusting it, then checked separately. `chainValid` and `verifyError` tell you whether it is trusted (OpenSSL with the standard root CAs); `hostnameMatches` tells you whether the name fits, the way browsers check it.
- **Direct and polite:** the Actor opens one TLS connection to each host you list. No third-party API, no crawling, no proxies.

### How to use

1. Put your domains in **Domains, hosts or URLs**, one per line: `example.com`, `mail.example.com:993` (any port that speaks TLS directly), `https://www.example.com/page` (only the host is used) or an IP address.
2. Optional: set **Only certificates expiring within (days)**.
3. Press **Start**. Download the results as CSV, Excel or JSON, or schedule the Actor (for example weekly) to get a sorted renewal list every time.

```json
{
  "hosts": ["apify.com", "www.python.org", "mail.example.com:993", "https://shop.example.com/cart"],
  "expiringWithinDays": 30,
  "timeoutSecs": 10,
  "concurrency": 5
}
```

### Output

One row per host:

```json
{
  "host": "shop.example.com",
  "port": 443,
  "daysToExpiry": 9,
  "expiresAt": "2026-11-15T12:00:00Z",
  "expired": false,
  "ok": true,
  "chainValid": true,
  "hostnameMatches": true,
  "selfSigned": false,
  "issuer": "Let's Encrypt",
  "issuerCN": "R11",
  "subjectCN": "shop.example.com",
  "sanNames": ["shop.example.com", "www.shop.example.com"],
  "validFrom": "2026-08-17T12:00:01Z",
  "notYetValid": false,
  "tlsVersion": "TLSv1.3",
  "ip": "203.0.113.10",
  "serialNumber": "4A3F0C2E9B1D",
  "fingerprintSha256": "9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08",
  "verifyError": null,
  "checkedAt": "2026-11-06T09:00:00Z",
  "error": null,
  "errorDetail": null
}
```

- `daysToExpiry` is whole days left: `0` means it expires within 24 hours, negative means it has expired.
- `ok` is `chainValid` and `hostnameMatches` together.
- `fingerprintSha256` changes when the certificate is replaced, handy to spot renewals between scheduled runs.
- When no certificate could be read, `error` says why (free rows): `invalid_host`, `dns_not_found`, `blocked_private_address`, `connection_refused`, `connection_timeout`, `tls_timeout`, `tls_handshake_failed` (with the reason in `errorDetail`, for example when the port does not speak TLS).

The record `SUMMARY` in the key-value store counts certificates read, failures, expired certificates, invalid chains, hostname mismatches and the soonest expiry.

### Limits (cannot be raised by input)

- 1,000 hosts per run (extra hosts are skipped with a note in `SUMMARY`); duplicates are checked once.
- At most 5 hosts at the same time, exactly one TLS connection per host, timeout up to 30 seconds.
- Direct TLS only: ports that need STARTTLS first (SMTP on 25/587, IMAP on 143) are not supported; use the TLS ports (465, 993, 995, 636 ...).
- Internal and private addresses (localhost, 10.x, 192.168.x, cloud metadata) are refused.
- `chainValid` uses only the certificates the server sends plus the standard trusted roots; a server that forgets an intermediate certificate is reported as invalid, as most non-browser clients would see it.
- Revocation (OCSP/CRL) is not checked.

### Pricing

Pay per event: **$0.0007 per checked certificate** ($0.70 per 1,000 certificates). You pay only for certificates that were read and listed in your dataset. Hosts that could not be reached, invalid input, hosts left out by the days filter and the demo are free. Store discounts apply automatically: BRONZE −10%, SILVER −20%, GOLD −30%. Set a maximum charge per run to cap spend: the Actor checks only as many hosts as that limit allows and tells you so.
On the Apify Free plan, the $5 of monthly platform credit covers about **7,100 certificates** a month — enough to try it on real data.

### FAQ

**Why is a certificate with `chainValid: false` still shown with dates?** The Actor reads the certificate first and checks it second, so you see the expiry and issuer even for expired, self-signed or untrusted certificates. `verifyError` says what failed.

**Does it check the hostname inside `chainValid`?** No. Trust (`chainValid`) and name (`hostnameMatches`) are separate fields, so a valid certificate served on the wrong host shows `chainValid: true, hostnameMatches: false`.

**Can I check a domain's registration expiry too?** Not here: this Actor reads TLS certificates only. For when the domain name itself expires, see the [Domain Expiry Checker](https://apify.com/ucchiii/domain-expiry-checker) from the same developer.

**How do I monitor certificates over time?** Create a task with your hosts and `expiringWithinDays: 30`, and schedule it weekly. Each run lists only what needs renewing soon.

### More tools from the same developer

- [Domain Expiry Checker](https://apify.com/ucchiii/domain-expiry-checker) — expiry dates of your own and your clients' domains in bulk, soonest first, with an N-days filter
- [Bulk URL Status Checker](https://apify.com/ucchiii/url-status-checker) — bulk HTTP status and redirect-chain checker for URL lists
- [Website Technology Detector](https://apify.com/ucchiii/website-technology-detector) — tech stack of websites in bulk: CMS, frameworks, analytics and tag IDs, CDN, consent tools
- [DNS Lookup](https://apify.com/ucchiii/dns-records-lookup) — bulk DNS lookup: A, AAAA, MX, NS, TXT, SPF and DMARC per domain

# Actor input Schema

## `hosts` (type: `array`):

One per entry: 'example.com', 'example.com:8443' (port; default 443), 'https://www.example.com/page' (only the host is used) or an IP address. Duplicates are removed. Each host gets one direct TLS connection (no STARTTLS). Internal and private addresses are refused. Leave empty to run a free demo (not charged). Up to 1,000 hosts per run.

## `expiringWithinDays` (type: `integer`):

Optional. Keep only certificates that expire within this many days, including already expired ones (0 = expired or expiring today). Hosts that could not be checked are always listed (free). Empty = list every host. Only listed certificates are charged.

## `timeoutSecs` (type: `integer`):

Time limit for connecting and for the TLS handshake of each host, in seconds. Allowed range 1 to 30 (default 10). Hosts that time out are listed with an error and not charged.

## `concurrency` (type: `integer`):

How many hosts are checked at the same time. Allowed range 1 to 5 (default 5). Each host gets exactly one connection.

## Actor input object example

```json
{
  "hosts": [
    "apify.com",
    "python.org",
    "github.com"
  ],
  "timeoutSecs": 10,
  "concurrency": 5
}
```

# Actor output Schema

## `results` (type: `string`):

One row per host, soonest expiry first: daysToExpiry, expiresAt, expired, chainValid, hostnameMatches, issuer, subjectCN, sanNames, tlsVersion, verifyError, error. Download as CSV, JSON or Excel from here.

## `summary` (type: `string`):

Record SUMMARY: certificates read, failed, expired, invalid chains, hostname mismatches, soonest expiry and the number charged.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "hosts": [
        "apify.com",
        "python.org",
        "github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/ssl-certificate-checker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "hosts": [
        "apify.com",
        "python.org",
        "github.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/ssl-certificate-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "hosts": [
    "apify.com",
    "python.org",
    "github.com"
  ]
}' |
apify call ucchiii/ssl-certificate-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ucchiii/ssl-certificate-checker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kmrfXP3t28Z6LyuZF/builds/enhoV4cvNkXxlG95a/openapi.json
