# SSL Certificate Checker: Expiry, Chain and Hostname (`forgeloop/ssl-certificate-checker`) Actor

Check the SSL/TLS certificates of many domains at once. Days left until expiry, chain trust, hostname match, self-signed and incomplete chains, issuer, SANs, key size, signature algorithm, TLS version and cipher. Flags certificates that expire soon. Pay per host.

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

## Pricing

from $1.00 / 1,000 host 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: Expiry, Chain and Hostname

Check the SSL/TLS certificates of many hosts in one run. For each host the Actor opens one TLS connection, reads the full certificate chain and tells you whether the certificate is valid, how many days are left until it expires and what is wrong with it: expired, self-signed, untrusted or incomplete chain, or a host name that does not match.

Built for teams that run many domains and want to catch an expiring certificate before their users do. Put your domains in, schedule the Actor once a day and look at the hosts with `expiresSoon: true` or `valid: false`.

### What it does

- **Connects with SNI** to each host on port 443 or any port you give (`mail.example.com:465`, `example.com:8443`), so it sees the same certificate a browser sees.
- **Validates the certificate** against the Mozilla CA list bundled with Node.js: chain trust, host name match (CN and subjectAltName, wildcards, IP addresses) and the validity dates.
- **Reports readable problem codes:** `expired`, `not_yet_valid`, `self_signed`, `untrusted_chain`, `incomplete_chain`, `hostname_mismatch`, `expires_soon`, `weak_key` (RSA under 2048 bits) and `weak_signature` (SHA-1 or MD5).
- **Returns the details:** subject CN, all subjectAltNames, issuer organization and CN, valid from and to, days left, serial number, SHA-256 fingerprint, key type and size, signature algorithm, negotiated TLS version and cipher, and the chain with subject, issuer and expiry of every certificate.
- **Summary record** `SUMMARY` in the key-value store: counts, the expired hosts, the hosts that expire soon and the 20 certificates that expire first.
- **Safe by design:** each host name is resolved first. Private, loopback, link-local and reserved addresses are blocked, and the Actor connects to the IP it checked. One TLS handshake per host, no HTTP request, no page download.

### Use cases

- **Expiry monitoring for many domains:** check all your domains, subdomains and customer domains every day and get warned 30 days (or any number you pick) before a certificate expires.
- **Renewal check after a migration:** confirm that every host serves the new certificate, the right chain and the right names after a move to a new CDN, load balancer or certificate authority.
- **Audit of a domain portfolio:** list issuers, key types, signature algorithms and TLS versions across all hosts, and find self-signed or weak certificates.
- **Mail and other TLS services:** check SMTPS (465), IMAPS (993), POP3S (995), LDAPS (636) or any port that speaks TLS from the first byte.
- **Alerts:** schedule the Actor and connect a webhook or an integration that reacts to items with `valid: false` or `expiresSoon: true`.

### Input

| Field | Description | Default |
|---|---|---|
| Hosts | `example.com`, `https://www.example.com/page`, `mail.example.com:465`, `1.1.1.1`, `[2606:4700:4700::1111]:853` | |
| Hosts as text | Optional. A whole column of hosts, one per line or separated by spaces or commas | |
| Warn days before expiry | A certificate that expires within this many days gets `expires_soon` | 30 |
| Timeout | Seconds per host for connect and handshake, 3 to 60 | 15 |
| Parallel hosts | Hosts checked at the same time, 1 to 20 | 5 |

URLs are reduced to their host. `http://` URLs are checked on port 443 too. `imaps://`, `smtps://`, `pop3s://`, `ldaps://` and `ftps://` use their standard TLS port.

Example, three hosts with a 14 day warning:

```json
{
  "hosts": ["example.com", "github.com", "expired.badssl.com"],
  "warnDays": 14
}
```

Example, a pasted list including a mail server and a custom port:

```json
{
  "hostsText": "example.com\nwww.example.com\nmail.example.com:465\nshop.example.com:8443",
  "timeoutSecs": 10,
  "maxConcurrency": 10
}
```

### Output

One dataset item per unique host and port:

```json
{
  "input": "github.com",
  "host": "github.com",
  "port": 443,
  "ip": "140.82.121.4",
  "valid": true,
  "problems": [],
  "daysLeft": 69,
  "expiresSoon": false,
  "validFrom": "2026-10-30T00:00:00.000Z",
  "validTo": "2027-01-27T23:59:59.000Z",
  "subjectCommonName": "github.com",
  "subjectOrganization": null,
  "subjectAltNames": ["github.com", "www.github.com"],
  "issuerOrganization": "Sectigo Limited",
  "issuerCommonName": "Sectigo Public Server Authentication CA DV E36",
  "hostnameMatches": true,
  "chainTrusted": true,
  "verifyError": null,
  "serialNumber": "3E1D6026B4B0AEA279DCA2EFBBCED82B",
  "fingerprint256": "7D:C4:D8:5C:F1:E3:10:97:12:25:BC:9A:92:57:67:90:43:A2:43:D7:0A:3C:C2:A9:1C:C5:D3:89:89:2C:27:76",
  "keyType": "EC",
  "keyBits": 256,
  "keyCurve": "prime256v1",
  "signatureAlgorithm": "ecdsa-with-SHA256",
  "tlsVersion": "TLSv1.3",
  "cipher": "TLS_AES_128_GCM_SHA256",
  "chainLength": 4,
  "chain": [
    { "subject": "github.com", "issuer": "Sectigo Public Server Authentication CA DV E36", "validTo": "2027-01-27T23:59:59.000Z" },
    { "subject": "Sectigo Public Server Authentication CA DV E36", "issuer": "Sectigo Public Server Authentication Root E46", "validTo": "2036-03-21T23:59:59.000Z" },
    { "subject": "Sectigo Public Server Authentication Root E46", "issuer": "USERTrust ECC Certification Authority", "validTo": "2038-01-18T23:59:59.000Z" },
    { "subject": "USERTrust ECC Certification Authority", "issuer": "USERTrust ECC Certification Authority", "validTo": "2038-01-18T23:59:59.000Z" }
  ],
  "checkedAt": "2026-11-19T08:00:04.716Z",
  "error": null
}
```

- `valid` is `true` only when the chain is trusted, the host name matches and the certificate is inside its validity dates. `expires_soon` alone does not make a certificate invalid.
- `daysLeft` counts full days until `validTo`. It is negative for an expired certificate.
- `verifyError` is the raw OpenSSL or Node.js code behind the problem, for example `CERT_HAS_EXPIRED` or `UNABLE_TO_VERIFY_LEAF_SIGNATURE`.
- `incomplete_chain` means the server does not send the intermediate certificate. Browsers often repair this on their own, but many API clients, apps and scripts fail. Fix it on the server.
- `chain` lists the leaf first, then each issuer as the chain was built, up to the root when the trust store knows it.
- `keyBits` is the RSA modulus length or the size of the elliptic curve.
- A host that does not resolve, refuses the connection, does not speak TLS or times out returns an item with `error` and `errorCode` (`DNS_FAILED`, `ECONNREFUSED`, `TIMEOUT`, `BLOCKED`, `INVALID_INPUT` and others).

Export the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

Pay per host: 0.001 USD per checked host, so 1.00 USD per 1,000 hosts. Expired, self-signed or otherwise invalid certificates are charged too, because finding them is the point. Hosts that do not resolve, refuse TLS or time out, invalid lines, duplicates and blocked private addresses are free. Set the maximum charge in Apify to cap the cost of a run.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start. 256 MB of memory is enough.

### Limits

- Validation uses the CA list bundled with Node.js (Mozilla). A certificate from a private or company CA shows up as `untrusted_chain`.
- No revocation check. The Actor does not query OCSP or CRLs, so a revoked certificate that is otherwise fine shows as valid.
- Only TLS from the first byte. Ports that need STARTTLS (SMTP 25 and 587, IMAP 143) are not supported.
- Servers that offer only TLS 1.1 or older, or only SHA-1 signatures, are refused by the OpenSSL in Node.js and return an error item instead of the certificate.
- The Apify platform has no IPv6 connectivity. IPv6 addresses and hosts with only AAAA records return an error item (`Network unreachable`).
- A connection the server drops during the handshake is retried once after 1.5 seconds. Timeouts and refused connections are not retried.
- When a host has several IP addresses, the Actor checks one of them (IPv4 first). Different servers behind one name can serve different certificates.
- When several problems exist at once, OpenSSL reports one verify error. `expired`, `not_yet_valid` and `hostname_mismatch` are always checked on their own.
- A host that resolves to a private, local or reserved address is blocked, even if the same name also has a public address.

### Data source, permitted use and legal

- **Data source:** The TLS certificates that the hosts you enter present during a standard TLS handshake. The Actor connects directly to each host. It uses no third-party database.
- **Metadata only:** The Actor reads the certificate chain and the negotiated protocol and cipher. It sends no HTTP request and downloads no content.
- **Snapshot:** Results show the certificate the server presented at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Check only hosts you own, operate or have permission to check, for example your own domains or those of your customers under contract. Do not use the Actor to scan networks or third-party systems without permission.
- **Your responsibility:** You choose the hosts and decide what happens with the results. If your input or the results contain personal data, you are the controller and need your own legal basis. Certificates can contain names of organizations and, rarely, of persons.
- **No circumvention:** The Actor makes one normal TLS handshake per host. It does not bypass rate limits, blocks or access restrictions, and it does not use proxies.
- **Request volume:** One TLS connection per host and run, at most 20 hosts at the same time, and duplicates are removed. Do not use it to put excessive load on any server.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

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

Host names, URLs or host:port values, one per entry. Port 443 is the default. URLs are reduced to their host, so https://www.example.com/page checks www.example.com:443. Use host:port for other TLS ports, like mail.example.com:465. Duplicates are removed. Format: a list of strings like \["example.com", "https://github.com", "mail.example.com:993"].

## `hostsText` (type: `string`):

Optional. Paste a whole column of hosts here instead, one per line or separated by spaces or commas. Used together with the list above.

## `warnDays` (type: `integer`):

A certificate that expires within this many days gets expiresSoon: true and the problem code expires_soon. Set 0 to flag only the last day.

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

Give up on a host after this many seconds for connect and TLS handshake. A host that times out gets a free error item.

## `maxConcurrency` (type: `integer`):

How many hosts are checked at the same time. Each host gets exactly one TLS connection.

## Actor input object example

```json
{
  "hosts": [
    "example.com",
    "github.com",
    "expired.badssl.com"
  ],
  "warnDays": 30,
  "timeoutSecs": 15,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

No description

# 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": [
        "example.com",
        "github.com",
        "expired.badssl.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/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": [
        "example.com",
        "github.com",
        "expired.badssl.com",
    ] }

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

```

## MCP server setup

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