# SSL Certificate Checker – Bulk Expiry, Chain & TLS Audit (`adamplaenitz/ssl-certificate-checker`) Actor

Check SSL/TLS certificates of many domains at once: expiry and warning window, trust chain, self-signed, hostname match, issuer, SANs, key, signature, TLS version and cipher. Optional problems-only mode for monitoring. Passive checks, no personal data.

- **URL**: https://apify.com/adamplaenitz/ssl-certificate-checker.md
- **Developed by:** [Adam Plänitz](https://apify.com/adamplaenitz) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 certificate checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Checker – Bulk Expiry, Chain & TLS Audit

**Check the SSL/TLS certificates of hundreds of domains in one run: days until expiry, trusted chain, self-signed and untrusted certificates, hostname match, issuer, SANs, key type and size, signature algorithm, TLS version and cipher.** Every host gets a clear `status`, a `valid` flag and a list of `problems` with severity and an explanation. Export as JSON, CSV or Excel, or connect to Slack, Google Sheets, Make, Zapier, n8n or webhooks.

### What does it do?

For every domain, URL or `host:port` in your list the Actor opens one TLS connection (no HTTP request, nothing is downloaded) and reports:

- **Expiry:** `validFrom`, `validTo`, `daysUntilExpiry`, `expiresSoon` with your own warning window (default 30 days).
- **Trust:** is the chain trusted, `self-signed`, issued by an untrusted root, or is an **intermediate certificate missing** (`incomplete-chain` – browsers often hide this, but curl, Java, Android apps and API clients fail)?
- **Hostname match:** does the certificate cover the host (SANs and wildcards, RFC 6125 rules)?
- **Certificate details:** issuer and issuer organisation, subject CN, all DNS SANs, **validation type (DV / OV / EV)**, key type and size (RSA 2048, EC P-256 …), signature algorithm, serial number, SHA-256 fingerprint, number of embedded Certificate Transparency SCTs.
- **Connection:** negotiated TLS version, cipher suite, key exchange group (e.g. X25519, X25519MLKEM768), ALPN (h2).
- **OCSP:** whether the server staples an OCSP response, the stapled status (good / revoked) and whether the certificate demands stapling (**OCSP must-staple**).
- **Optional:** test whether the server still accepts **TLS 1.0 / TLS 1.1**.
- **Monitoring mode:** output only certificates with problems (expired, expiring soon, untrusted, mismatch, weak …) – healthy ones are counted in the run summary but not stored and **not charged**.

#### Status values

| `status` | Meaning |
|---|---|
| `valid` | Trusted, in its validity period, matches the host name, no high-severity weakness |
| `expiring-soon` | Valid, but expires within your warning window |
| `expired` / `not-yet-valid` | Outside the validity period |
| `hostname-mismatch` | Certificate does not cover the checked host name |
| `self-signed` | Self-signed certificate |
| `untrusted` | Untrusted root, expired intermediate or another chain error |
| `incomplete-chain` | Intermediate certificate missing (or unknown issuer) |
| `revoked` | The stapled OCSP response says "revoked" |
| `weak` | Trusted, but e.g. RSA < 2048 bits, SHA-1 signature, TLS < 1.2, weak cipher, must-staple without staple |
| `error` | The check could not be done (DNS error, timeout, connection refused, invalid input) – **free of charge** |

If several problems apply, the most important one decides the status; all of them are listed in `problems`.

#### Problem codes

| Code | Severity |
|---|---|
| `expired`, `not_yet_valid`, `revoked`, `self_signed`, `untrusted_root`, `chain_expired`, `chain_invalid`, `hostname_mismatch` | critical |
| `incomplete_chain`, `weak_key`, `weak_signature`, `outdated_protocol`, `weak_cipher`, `must_staple_not_stapled` | high |
| `expiring_soon` | high (≤ 7 days) / medium |
| `tls10_enabled`, `tls11_enabled`, `no_forward_secrecy`, `weak_chain_signature`, `stale_ocsp_staple` | medium |
| `no_tls13`, `long_validity` | low (informational, ignored by the monitoring mode) |

### Who is it for?

- **Web agencies and hosting providers** watching dozens or thousands of customer domains.
- **DevOps / SRE teams:** schedule a daily run in monitoring mode and send new problems to Slack or e-mail before a certificate expires.
- **IT / security teams** auditing their own estate or checking a supplier's endpoints they are allowed to assess.
- **Mail and API endpoints:** check implicit-TLS ports such as `smtp.example.com:465`, `imap.example.com:993` or `api.example.com:8443`.

### Input

| Field | Default | Description |
|---|---|---|
| Domains or URLs | – | `example.com`, `https://www.example.com/page`, `mail.example.com:465`. Normalised (lower case, punycode, path removed) and de-duplicated. |
| Expiry warning (days) | 30 | Window for `expiring-soon`. |
| Only output problems | off | Monitoring mode (see above). |
| Test TLS 1.0 / 1.1 | off | Two extra handshakes per host. |
| Default port | 443 | Used when an entry has no port. |
| Parallel checks | 20 | 1–100. |
| Timeout per host | 10 s | Connection + handshake. Connection resets and temporary DNS errors are retried automatically. |

### Output example (shortened)

```json
{
  "input": "microsoft.com",
  "host": "microsoft.com",
  "port": 443,
  "status": "valid",
  "valid": true,
  "problemSummary": "none",
  "daysUntilExpiry": 79,
  "validFrom": "2026-10-22T15:50:49.000Z",
  "validTo": "2027-01-30T14:50:49.000Z",
  "issuer": "Microsoft TLS G2 RSA CA OCSP 04",
  "issuerOrganization": "Microsoft Corporation",
  "subjectCommonName": "microsoft.com",
  "subjectOrganization": "Microsoft Corporation",
  "validationType": "OV",
  "hostnameMatch": true,
  "subjectAltNames": ["microsoft.com", "s.microsoft.com", "…"],
  "sanCount": 157,
  "trusted": true,
  "chainLength": 4,
  "chain": [
    { "subject": "microsoft.com", "issuer": "Microsoft TLS G2 RSA CA OCSP 04", "validTo": "2027-01-30T14:50:49.000Z", "selfSigned": false, "signatureAlgorithm": "sha384WithRSAEncryption" },
    { "subject": "Microsoft TLS G2 RSA CA OCSP 04", "issuer": "Microsoft TLS RSA Root G2", "validTo": "2029-06-03T20:02:59.000Z", "selfSigned": false, "signatureAlgorithm": "sha384WithRSAEncryption" },
    { "subject": "Microsoft TLS RSA Root G2", "issuer": "DigiCert Global Root G2", "validTo": "2029-06-19T23:59:59.000Z", "selfSigned": false, "signatureAlgorithm": "sha384WithRSAEncryption" },
    { "subject": "DigiCert Global Root G2", "issuer": "DigiCert Global Root G2", "validTo": "2038-01-15T12:00:00.000Z", "selfSigned": true, "signatureAlgorithm": "sha256WithRSAEncryption" }
  ],
  "keyType": "RSA",
  "keySize": 2048,
  "signatureAlgorithm": "sha384WithRSAEncryption",
  "tlsVersion": "TLSv1.3",
  "cipher": "TLS_AES_256_GCM_SHA384",
  "keyExchange": "X25519MLKEM768",
  "alpn": "h2",
  "ocspStapled": true,
  "ocspStatus": "good",
  "ocspMustStaple": false,
  "ctSctCount": 2,
  "problems": [],
  "handshakeMs": 94,
  "checkedAt": "2026-11-12T11:21:05.000Z",
  "error": null
}
```

A host with a missing intermediate certificate:

```json
{
  "host": "incomplete-chain.badssl.com",
  "status": "incomplete-chain",
  "valid": false,
  "trusted": false,
  "chainError": "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
  "problems": [
    { "code": "incomplete_chain", "severity": "high", "message": "The server does not send the intermediate certificate(s). Browsers may compensate, but many clients (curl, Java, Android apps, API clients) will fail." },
    { "code": "no_tls13", "severity": "low", "message": "TLS 1.3 is not supported (negotiated TLS 1.2)." }
  ]
}
```

The **Overview** table shows host, status, days left, expiry date, problems, issuer, validation type, host match, trust, TLS version, key and signature. The key-value store record `RUN-SUMMARY` contains counts per status, errors, duplicates and charged results.

### Pricing and speed

See the **Pricing** tab. You pay per checked certificate; **rows for failed checks (DNS error, timeout, connection refused, invalid input) are free**, and in monitoring mode healthy certificates are not charged either. Duplicates are removed before checking.

A check takes one TLS handshake (typically 50–500 ms). In a cloud test with the default 20 parallel checks, the Tranco top 1,000 domains (about 30 % of them without a reachable HTTPS service) took 110 seconds; unreachable hosts wait for the timeout. The Actor runs with 256 MB memory. You can set a maximum cost per run – the Actor stops cleanly when it is reached.

### How it works, privacy and responsible use

- **Passive check only:** one standard TLS handshake per host (three with the TLS 1.0/1.1 test). No HTTP request, no port scanning, no vulnerability probing, no login attempts.
- **Please check only domains you own or are allowed to assess.** Results are technical indicators, **not a security certification or audit**.
- Trust is evaluated with Node.js / OpenSSL and the Mozilla root store bundled with Node.js – the same basis many API clients use. Browsers can differ slightly (e.g. they may fetch a missing intermediate themselves).
- **No personal data:** the organisation name is only shown for OV/EV certificates (verified companies); for individual-validated (IV) certificates it is omitted. E-mail and URI entries in the SAN list are dropped. No WHOIS data is collected.
- Private, loopback, link-local and internal addresses/host names are refused.

### Limits

- **Revocation** is only reported when the server staples an OCSP response (the stapled status is read, its signature is not verified). The Actor does not query CRLs or OCSP responders itself – a revoked certificate without stapling shows as valid.
- **STARTTLS** (SMTP port 25/587, IMAP 143) is not supported – use implicit-TLS ports (465, 993, 995 …).
- The `chain` is the certification path built by the client: the certificates the server sent plus the trusted root, if found.
- IPv4 is preferred; IPv6-only hosts may not be reachable from the Apify cloud.
- Only the negotiated TLS version and cipher are reported (not a full cipher-suite enumeration).

Questions or feature requests? Please open an issue in the **Issues** tab.

# Actor input Schema

## `domains` (type: `array`):

One entry per line. Bare domains (example.com), URLs (https://www.example.com/page) and host:port (mail.example.com:465) are accepted. Entries are normalised (lower case, punycode for international domains, no path) and duplicates removed. Only check domains you own or are allowed to assess.

## `expiryWarningDays` (type: `integer`):

Certificates expiring within this many days get status 'expiring-soon' and the problem 'expiring_soon' (severity high within 7 days, otherwise medium).

## `onlyProblems` (type: `boolean`):

Output only certificates with at least one medium, high or critical problem (expired, expiring soon, untrusted, hostname mismatch, weak key …) plus failed checks. Healthy certificates are counted in the run summary but not stored and not charged. Ideal for scheduled monitoring.

## `checkLegacyTls` (type: `boolean`):

Makes two extra handshakes per host (TLS 1.0 and TLS 1.1 only) and reports whether the server still accepts these deprecated protocols. Slightly slower.

## `defaultPort` (type: `integer`):

TLS port used when an entry has no explicit port. Use host:port in the list for individual ports (implicit TLS only, e.g. 443, 465, 993, 995, 8443 – STARTTLS is not supported).

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

How many hosts are checked at the same time (1–100).

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

Maximum time for connecting and completing the TLS handshake. Transient errors (connection reset, temporary DNS failure) are retried automatically.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com",
    "wikipedia.org",
    "example.com"
  ],
  "expiryWarningDays": 30,
  "onlyProblems": false,
  "checkLegacyTls": false,
  "defaultPort": 443,
  "concurrency": 20,
  "timeoutSecs": 10
}
```

# Actor output Schema

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

One item per checked host with status, expiry, chain, key, protocol and a list of problems.

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

Counts per status, errors, duplicates and charged results.

# 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 = {
    "domains": [
        "apify.com",
        "github.com",
        "wikipedia.org",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adamplaenitz/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 = { "domains": [
        "apify.com",
        "github.com",
        "wikipedia.org",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("adamplaenitz/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 '{
  "domains": [
    "apify.com",
    "github.com",
    "wikipedia.org",
    "example.com"
  ]
}' |
apify call adamplaenitz/ssl-certificate-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adamplaenitz/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/nmYbGgnrhzfJXeowm/builds/qc3cF1bRgpPJA20bP/openapi.json
