# SSL Certificate & Security Headers Checker (`ataism/ssl-security-headers-checker`) Actor

Bulk SSL/TLS certificate and security headers check: expiry, days left, issuer, chain, hostname match, HSTS, CSP, with an A-F grade. $1 per 1,000 domains.

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

## Pricing

$1.00 / 1,000 domain 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 & Security Headers Checker

Check the **SSL/TLS certificate and the HTTP security headers** of many domains in one run: one row per domain with the certificate's issuer, expiry date and days left, chain and hostname validity, protocol and cipher, key and signature, SHA-256 fingerprint, the HSTS, CSP, X-Frame-Options and other security headers of the homepage, whether `http://` redirects to `https://`, and an **A–F grade** with a list of findings. No browser, no proxy, no key.

**Price: $1.00 per 1,000 domains ($0.001 per domain checked)**, plus Apify's default Actor-start event. Domains that fail completely, and blocked ones, are free.

- **Certificate monitoring in bulk:** `daysRemaining`, `expired`, `chainValid`, `hostnameMatch`, `selfSigned` and the issuer for up to 1,000 domains per run. Schedule it weekly and filter on `daysRemaining < 30`.
- **Reports problems instead of failing:** expired, self-signed, untrusted and wrong-host certificates are read and reported (the check does not reject them), with the exact OpenSSL reason.
- **Security headers with a transparent grade:** HSTS (max-age, includeSubDomains, preload), CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP/COEP/CORP and Server/X-Powered-By disclosure. The rubric is printed below; every point lost is a finding with a code.
- **Optional TLS 1.0/1.1 test:** two extra handshakes per domain show whether a server still accepts the deprecated versions (same price).
- **Quick start:** press *Start*. The prefilled input checks `crawlee.dev` and `apify.com` (two sites run by Apify): about 3 seconds and $0.002.

> **Light and polite.** Per domain: one TLS handshake, robots.txt, one GET of the homepage (only its headers are read) and one GET of `http://host/` to see the redirect. robots.txt is obeyed for the GETs, an honest User-Agent is sent, at most one request per second per host, and blocks (401, 403, 429, 503, challenge pages) are reported as free rows, never worked around.

### What it does

For each domain:

1. **Guard.** Social-media, video and Google hosts are refused before any DNS lookup (`platform`). The name is resolved and every address must be public: private, loopback, link-local, CGNAT and reserved ranges are refused (`ssrf`), and the TLS connection goes to that checked address (the host name is sent as SNI), so a name cannot be checked as public and then connect to an internal address.
2. **TLS.** One handshake to `host:port` (443 unless set) with SNI and `rejectUnauthorized: false`: certificate subject, SANs, issuer, validity dates, days remaining, expired and self-signed flags, chain validity against the Mozilla root store (`chainValid`, `chainError`), hostname match (`tls.checkServerIdentity`), negotiated protocol and cipher, ALPN, key type and size, signature algorithm, serial number and SHA-256 fingerprint. Nothing is sent over this connection; it closes after the handshake. A server that only speaks TLS 1.0/1.1 gets one more handshake that allows them, so it is reported as outdated, not as "no TLS".
3. **TLS 1.0/1.1 test (optional).** Two handshakes pinned to TLS 1.0 and TLS 1.1.
4. **Headers.** robots.txt of `https://host:port`, then one GET of `https://host:port/`. Redirects are followed (at most 5), each hop re-checked by the guard, the platform list and that host's robots.txt. The headers of the final response are parsed; **the page body is never read**.
5. **HTTP to HTTPS.** One GET of `http://host/` (port 80). Its `Location` is read: an `https://` target means `httpToHttps: true` (that target is not requested again). Plain-http hops are followed up to 5 times. Port 80 closed means `httpCheck: "port-closed"` (not a finding).
6. **Grade and findings** by the rubric below.

Up to 5 domains are checked at the same time (different hosts); requests to one host are spaced at least 1 second apart, longer when robots.txt asks for a `Crawl-delay`.

### Input

| Field | What it does |
|---|---|
| **Domains** (`domains`) | Host names or URLs, one per line, up to 1,000 per run. `example.org`, `www.example.org:8443` and `https://example.org/any/path` all work; the path is ignored and a port in the entry wins over **Port**. Duplicates (same host and port) are checked once. |
| **Port** (`port`) | TLS port for entries without their own port. Default 443. Headers are read from `https://host:port/`; the HTTP redirect check always uses port 80. |
| **Test TLS 1.0 and 1.1** (`checkLegacyTls`) | Default off. On: two extra handshakes per domain fill `tls10Accepted` and `tls11Accepted`. Same price. |

#### Example inputs

**1. Check your own sites (certificate expiry and headers):**

```json
{ "domains": ["crawlee.dev", "apify.com"] }
```

**2. Full audit including deprecated TLS versions:**

```json
{
  "domains": ["www.example.org", "shop.example.com", "https://blog.example.net/"],
  "checkLegacyTls": true
}
```

**3. Services on a non-standard port:**

```json
{
  "domains": ["mail.example.org", "vpn.example.org:4443"],
  "port": 8443
}
```

(`mail.example.org` is checked on 8443, `vpn.example.org` on 4443.)

### Output

One row per domain (shortened; every row has all columns, `null` when not applicable):

```json
{
  "input": "crawlee.dev",
  "domain": "crawlee.dev",
  "port": 443,
  "status": "ok",
  "billable": true,
  "grade": "B",
  "score": 80,
  "issues": "csp-missing, xcto-missing, referrer-policy-missing",
  "findings": [
    { "severity": "medium", "code": "csp-missing", "message": "No Content-Security-Policy header." },
    { "severity": "low", "code": "xcto-missing", "message": "X-Content-Type-Options: nosniff is missing." },
    { "severity": "low", "code": "referrer-policy-missing", "message": "No Referrer-Policy header." },
    { "severity": "info", "code": "hsts-no-subdomains", "message": "HSTS does not include subdomains." }
  ],
  "ip": "99.86.18.19",
  "protocol": "TLSv1.3",
  "cipher": "TLS_AES_128_GCM_SHA256",
  "alpn": "h2",
  "certSubjectCN": "*.crawlee.dev",
  "certSans": ["*.crawlee.dev", "crawlee.dev"],
  "certIssuer": "CN=Amazon RSA 2048 M04, O=Amazon, C=US",
  "certIssuerOrg": "Amazon",
  "validFrom": "2026-10-04T00:00:00.000Z",
  "validTo": "2027-04-19T23:59:59.000Z",
  "daysRemaining": 175,
  "expired": false,
  "selfSigned": false,
  "chainValid": true,
  "chainError": null,
  "chainSubjects": ["*.crawlee.dev", "Amazon RSA 2048 M04", "Amazon Root CA 1", "Starfield Services Root Certificate Authority - G2"],
  "hostnameMatch": true,
  "keyType": "rsa",
  "keySize": 2048,
  "signatureAlgorithm": "sha256WithRSAEncryption",
  "fingerprintSha256": "E8:B6:1A:EE:00:C5:55:F4:...:1C:8C",
  "tls10Accepted": null,
  "tls11Accepted": null,
  "finalUrl": "https://crawlee.dev/",
  "httpStatus": 200,
  "hstsPresent": true,
  "hstsMaxAge": 31556952,
  "hstsIncludeSubDomains": false,
  "cspPresent": false,
  "xFrameOptions": "SAMEORIGIN",
  "server": "nginx",
  "httpToHttps": true,
  "httpCheck": "redirects-to-https",
  "httpRedirectLocation": "https://crawlee.dev/",
  "errorCode": null,
  "message": null,
  "checkedAt": "2026-10-26T13:40:12.000Z"
}
```

`status` is `ok` (TLS and headers read), `partial` (TLS read, headers not: `errorCode` says why) or `error` (no TLS result). `billable` says whether the row was charged. The dataset has four views: *Overview*, *Certificate*, *Security headers* and *Problems*. `securityHeaders` holds the raw values of the checked headers (each capped at 1,024 characters).

#### Grading rubric

Start at 100 and subtract per finding: **high 20, medium 10, low 5, info 0**. **Any critical finding makes the grade F.** A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 60, F below 60. Without any TLS connection the grade is F; when TLS worked but the headers could not be read (blocked, robots.txt, network), `grade` is `null` and only the TLS findings are listed.

| Severity | Finding codes |
|---|---|
| critical | `tls-unavailable` (no TLS handshake), `cert-expired`, `cert-not-yet-valid`, `hostname-mismatch`, `chain-untrusted` (self-signed or unverifiable chain) |
| high (−20) | `cert-expires-soon` (≤ 14 days), `protocol-outdated` (negotiated TLS 1.0/1.1), `legacy-tls-accepted` (TLS 1.0 or 1.1 accepted, when tested), `weak-key` (RSA < 2048, EC < 256 bits), `weak-signature` (SHA-1, MD5), `hsts-missing`, `https-downgrade` (HTTPS redirects to an http:// page) |
| medium (−10) | `hsts-invalid` (no valid max-age), `csp-missing`, `clickjacking-unprotected` (no X-Frame-Options DENY/SAMEORIGIN and no CSP frame-ancestors), `http-not-redirected` (http:// does not redirect to https://) |
| low (−5) | `cert-expires-30d` (15–30 days), `no-tls13`, `hsts-short` (max-age < 180 days), `csp-report-only`, `xcto-missing`, `referrer-policy-missing`, `server-version-disclosed` (Server header with a version), `x-powered-by-disclosed` |
| info (0) | `permissions-policy-missing`, `cross-origin-headers-missing` (COOP/COEP/CORP: only needed for cross-origin isolation), `hsts-no-subdomains` |

The grade is a quick triage aid, not a certification or a full vulnerability scan; other tools weigh things differently.

#### Error codes

| `errorCode` | Row | Meaning | Charged |
|---|---|---|---|
| `invalid-input` | error | Not a host name or http(s) URL. | no |
| `platform` | error (or partial, after a redirect) | A social-media, video or Google host. Never contacted. | no (yes if TLS of your domain was read) |
| `ssrf` | error (or partial) | A private, loopback, link-local or reserved address, or a local name. | no (same) |
| `dns` | error | The name does not resolve. | no |
| `connection-refused`, `timeout`, `tls-handshake`, `network`, `no-certificate` | error | No TLS handshake (port closed, no TLS on that port, no answer in 10 s). Graded F. | no |
| `refused` | partial | 401, 403, 429, 503, 999 or a bot challenge on the homepage. Not retried, not worked around; no further request to that host; after 2 refusals a host is skipped (`host-skipped`). TLS is still reported. | **no** |
| `robots-unavailable` | partial | robots.txt answered 5xx or 429, or could not be read, twice, or did not answer within the domain's 36 s: the homepage is not requested. | **no** |
| `robots-blocked` | partial | robots.txt disallows `/` for this Actor: the homepage is not requested. | yes (TLS result) |
| `slow-host` | partial | robots.txt asks for a `Crawl-delay` over 30 s (honoured in full, never shortened, so the GET is skipped). | yes (TLS result) |
| `redirects`, `headers-too-large`, `http`, `timeout`, `network`, `dns` | partial | More than 5 redirects; response headers over 64 KB; another HTTP problem; the homepage did not answer in time (15 s, or the domain's 36 s ran out); the homepage could not be reached. | yes (TLS result) |
| `internal` | error | An unexpected error in this Actor, not a problem with your site. | no |

#### RUN_SUMMARY (key-value store record)

Charged and free rows, grades, TLS handshakes and HTTP requests made, robots.txt bytes read, seconds spent waiting for `Crawl-delay`, errors by code and `stoppedBy`: `finished`, `max-charge`, `unpaid-work-cap`, `time-limit`, `migrating`, `aborted` or `error`.

### Pricing

Pay per event: **$0.001 per domain checked** (event `domain-checked`), plus Apify's standard Actor-start event. No other fee from this Actor.

| Domains with a usable result | Cost |
|---|---|
| 2 (prefilled example) | $0.002 |
| 100 | $0.10 |
| 1,000 (maximum per run) | $1.00 |

**Charged:** a row with a TLS result (the certificate was read, whatever its problems) that was not blocked. **Free:** rows without a TLS result, invalid, platform and private inputs, and rows where the site refused the header check (block or challenge) or its robots.txt could not be read. The TLS 1.0/1.1 test costs nothing extra. Set **Max total charge** in the run options to cap spending: the run checks the budget before starting each domain and never writes a row it cannot charge.

To keep free work bounded, a run stops (`stoppedBy: "unpaid-work-cap"`) once 100 or more domains gave no usable result **and** they outnumber the charged ones. Everything found up to then is saved.

### Use it via API, n8n or Make

Get an API token in Apify Console under *Settings*, *API & Integrations*, and keep it in an environment variable (`APIFY_TOKEN` below). Never paste it into shared code.

**cURL** (starts a run, waits and returns the rows; the synchronous endpoint waits up to 5 minutes, so use it for lists of up to a few hundred domains):

```bash
curl -X POST "https://api.apify.com/v2/acts/ataism~ssl-security-headers-checker/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["crawlee.dev", "apify.com"]}'
```

**Python** (`pip install "apify-client>=3"`):

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("ataism/ssl-security-headers-checker").call(run_input={
    "domains": ["crawlee.dev", "apify.com"],
})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["domain"], row["grade"], row["daysRemaining"], row["issues"])
```

(With apify-client versions before 3.0, `call()` returns a dict: use `run["defaultDatasetId"]`.)

**JavaScript** (`npm install apify-client`):

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('ataism/ssl-security-headers-checker').call({
    domains: ['crawlee.dev', 'apify.com'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const row of items.filter((r) => r.daysRemaining !== null && r.daysRemaining < 30)) {
    console.log(`${row.domain}: certificate expires in ${row.daysRemaining} days`);
}
```

**n8n:**

1. Add a Schedule trigger (for example every Monday).
2. Add the **Apify** node, operation **Run an Actor and get dataset**, Actor `ataism/ssl-security-headers-checker`, input `{"domains": ["your-site.example", "shop.your-site.example"]}`.
3. Add an IF node on `daysRemaining` < 30 or `grade` = `F`, and send those rows to Slack or email.

**Make:**

1. Add the **Apify** module **Run an Actor**, choose `ataism/ssl-security-headers-checker`, put your domains in the input JSON and set *Run synchronously* to *Yes*.
2. Add the **Apify** module **Get Dataset Items** and map the run's default dataset ID (one bundle per domain).
3. Filter on `daysRemaining` or `grade` and send the rows to Google Sheets, a ticket system or a webhook.

### How it relates to our other Actors

- **[Web Stack Patch Checker](https://apify.com/ataism/web-stack-patch-checker)** also reads response headers, but only to find the **PHP version** (`X-Powered-By`, `Server`, cookie names) and say whether it indicates a CVE fix. It does not look at certificates or security headers. This Actor reads the security headers and the certificate, and only flags `Server`/`X-Powered-By` as information disclosure; it does not interpret versions.
- **[SEO Page Audit](https://apify.com/ataism/seo-page-audit)** reads page content (titles, meta, headings, schema). This Actor never reads the page body.
- **[DNS Records Lookup](https://apify.com/ataism/dns-records)** covers the DNS side (A, MX, TXT, SPF, DMARC, CAA). Together with this Actor you get the domain's DNS and TLS posture.

### Privacy and terms

- Per domain the Actor makes one TLS handshake (three with the TLS 1.0/1.1 test), reads robots.txt, sends one GET to the homepage and one to `http://host/`. It reads response headers only, never page bodies, and stores no cookies. Certificates are public by design; they can contain an organisation's name and, rarely, a contact address in the subject, which is passed through as given.
- Nothing is sent to any AI or third-party service. No logins, no proxies, no CAPTCHA solving, no exploit or scan traffic.
- **Only check domains you own or manage, or have permission to check.** You are responsible for that; the Actor obeys robots.txt for its GETs but does not know your agreement with the site.
- User-Agent: `ssl-security-headers-checker-actor/0.1 (https://apify.com/ataism/ssl-security-headers-checker)`. In robots.txt, `User-agent: ssl-security-headers-checker-actor` targets this Actor (exact match; otherwise the `*` group applies).

### Limits and honest caveats

- 1,000 domains and 60 minutes per run; at most 36 s of work per domain (waits for the 1-request-per-second limit and `Crawl-delay` not counted); within that, 10 s for DNS and per TLS handshake, 8 s per TLS 1.0/1.1 probe, 15 s per HTTP answer, 20 s to read robots.txt. A domain that runs out of time keeps its TLS result (`errorCode: "timeout"`, charged) and its `http://` check is `skipped`.
- Only what one connection shows: the certificate served to our SNI from one IP address (the first IPv4 address of the name). Load-balanced or geo-distributed servers can serve different certificates. OCSP/revocation, certificate transparency and the HSTS preload *list* are not checked (`hstsPreload` is the directive only). `security.txt` is not checked.
- The chain is verified against the root store of Node.js (Mozilla's list). A certificate trusted only by an internal or OS-specific root shows `chainValid: false`.
- Headers come from the final response of the homepage after redirects; other pages of a site can send different headers. A CDN or proxy can add or remove headers.
- The plain-HTTP check uses port 80 and the robots.txt of the host over HTTPS (see STORE.md for why).
- Default memory is 256 MB, plenty for 1,000 domains (measured peak about 110 MB).

### FAQ

**Is a site with an expired certificate an error row?** No. The certificate is read and reported (`expired: true`, grade F) and the row is charged: that is exactly the result you are looking for.

**Why is my site `refused`?** It answered 401, 403, 429, 503 or a bot challenge to our homepage GET. The Actor does not retry or work around that. The TLS columns are still filled and the row is free. Allow the User-Agent above, or check another hostname.

**Does it scan for vulnerabilities?** No. It reads what any browser sees on the first connection: the certificate and the response headers. The grade is a triage aid.

**Does the default run work without setup?** Yes. It checks `crawlee.dev` and `apify.com` (about 3 seconds, $0.002).

### Open-source components

The Actor uses the **Apify SDK** (`apify` 3.7.2, Apache-2.0) and Node.js's built-in `tls` and `crypto`. The header parser, grading, robots.txt parser and fetching are plain code in this Actor, with no other dependencies.

# Actor input Schema

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

Host names or URLs, one per line, up to 1,000 per run. "example.org", "www.example.org:8443" and "https://example.org/any/path" all work: the path is ignored, a port in the entry wins over the Port field. Private, internal and social-media/Google hosts are refused.

## `port` (type: `integer`):

TLS port for entries without their own port. Default 443. The headers are read from https://host:port/; the plain-HTTP redirect check always uses port 80.

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

Off by default. On: two extra TLS handshakes per domain, pinned to TLS 1.0 and TLS 1.1, report whether the server still accepts these deprecated versions (RFC 8996). Same price.

## `mode` (type: `string`):

Internal: "selfTest" runs the maintainer health check and saves no items.

## Actor input object example

```json
{
  "domains": [
    "crawlee.dev",
    "apify.com"
  ],
  "port": 443,
  "checkLegacyTls": false,
  "mode": "run"
}
```

# Actor output Schema

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

One item per domain: grade and findings, certificate (issuer, expiry, days left, chain, hostname match), protocol and cipher, security headers and the HTTP-to-HTTPS redirect (JSON, CSV, Excel or XML).

## `runSummary` (type: `string`):

Charged and free rows, grades, TLS handshakes and HTTP requests made, errors by code and why the run stopped.

# 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": [
        "crawlee.dev",
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ataism/ssl-security-headers-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": [
        "crawlee.dev",
        "apify.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ataism/ssl-security-headers-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": [
    "crawlee.dev",
    "apify.com"
  ]
}' |
apify call ataism/ssl-security-headers-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ataism/ssl-security-headers-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/GOizcIbkoIlh0f63p/builds/k2xeoKQZFlPukV2hA/openapi.json
