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

Bulk-check SSL/TLS certificates (validity, expiry date, days left, issuer, SANs, TLS version) and HTTP security headers (HSTS, CSP, X-Frame-Options…) with a grade for each domain. $0.0019 per domain.

- **URL**: https://apify.com/nordic-data/ssl-certificate-security-headers-checker.md
- **Developed by:** [Niklas Bergström](https://apify.com/nordic-data) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.90 / 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 HTTP security headers** of hundreds of domains in one run. For every host you get certificate validity (with the exact validation error), expiry date and days remaining, issuer, SANs, key type and size, TLS version and cipher — plus a **security-headers grade** (HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP/CORP), an HTTP-to-HTTPS redirect check and a clear list of problems.

**$0.0019 per domain checked.** Hosts that don't resolve or can't be reached, invalid inputs, duplicates and (with *Only output hosts with problems*) healthy hosts are free.

### What you get

| Field | Meaning |
|---|---|
| `certificateValid`, `validationError` | Trusted chain + hostname match, or the reason it fails (expired, self-signed, hostname mismatch …) |
| `validFrom`, `validTo`, `daysRemaining`, `expired` | Certificate dates |
| `subjectCN`, `subjectO`, `issuerCN`, `issuerO`, `validationType`, `sans`, `sanCount` | Who the certificate is for and who issued it |
| `tlsVersion`, `cipher`, `keyType`, `keySize`, `signatureAlgorithm`, `serialNumber`, `sha256Fingerprint`, `chainLength` | Technical details |
| `headersGrade`, `headersScore`, `securityHeaders`, `missingHeaders`, `hstsMaxAge`, `hstsPreload` | Security headers (A+ to F) |
| `httpRedirectsToHttps`, `infoLeakHeaders` | Plain-HTTP redirect check and `Server` / `X-Powered-By` disclosure |
| `problems` | `invalid-certificate`, `certificate-expired`, `certificate-expiring-soon`, `outdated-tls`, `no-https`, `no-hsts`, `weak-security-headers`, `http-not-redirected` |

### Use cases

- **Certificate expiry monitoring:** schedule a daily run and alert when `daysRemaining` drops below your threshold.
- **Security posture checks** for a portfolio of client, brand or subsidiary domains.
- **Sales prospecting for security and hosting services:** find sites with expired certificates or missing headers.
- **Vendor due diligence:** quick TLS and header hygiene check for suppliers.

### Input example

```json
{
  "domains": ["apify.com", "github.com", "expired.badssl.com"],
  "checkHeaders": true,
  "expiryWarningDays": 30,
  "onlyProblems": false,
  "maxConcurrency": 15
}
```

### Output example

```json
{
  "recordType": "site",
  "host": "github.com",
  "port": 443,
  "certificateValid": true,
  "validationError": null,
  "tlsVersion": "TLSv1.3",
  "subjectCN": "github.com",
  "issuerO": "Sectigo Limited",
  "validTo": "2027-01-28T23:59:59Z",
  "daysRemaining": 76,
  "sanCount": 2,
  "keyType": "EC",
  "keySize": 256,
  "headersGrade": "A",
  "missingHeaders": ["permissions-policy", "cross-origin-opener-policy", "cross-origin-resource-policy"],
  "httpRedirectsToHttps": true,
  "problems": [],
  "checkedAt": "2026-11-12T07:00:00Z"
}
```

(Example values.)

### How it works

The Actor opens a TLS connection to each host (SNI, port 443 unless you give another port) and validates the certificate against the standard trust store; if validation fails it reconnects without validation so you still get the certificate details. It then makes one HTTPS request to read the response headers and one plain-HTTP request to check the redirect. Passive checks only: no vulnerability scanning, no login.

### Related Actors

- [Domain WHOIS & DNS Lookup](https://apify.com/nordic-data/domain-whois-dns-lookup): registrar, expiry and DNS records.
- [Website Tech Stack Detector](https://apify.com/nordic-data/website-tech-stack-detector)
- [Bulk URL Status & Redirect Chain Checker](https://apify.com/nordic-data/bulk-url-status-redirect-checker)

# Changelog

This Actor's version history is a separate document: https://apify.com/nordic-data/ssl-certificate-security-headers-checker/changelog.md

# Actor input Schema

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

Hostnames or URLs, e.g. apify.com, www.example.se or https://shop.example.com:8443. One result per unique host.

## `checkHeaders` (type: `boolean`):

Grade HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy and COOP/CORP, check HTTP→HTTPS redirect and flag Server / X-Powered-By leaks.

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

Flag certificates that expire within this many days.

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

Output only hosts with an invalid, expired or soon-expiring certificate, old TLS, missing HSTS, weak headers or no HTTPS redirect. Hidden hosts are not charged.

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

Hosts checked in parallel (1-40).

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com",
    "expired.badssl.com"
  ],
  "checkHeaders": true,
  "expiryWarningDays": 30,
  "onlyProblems": false,
  "maxConcurrency": 15
}
```

# Actor output Schema

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

Main results (view: Overview).

## `runStats` (type: `string`):

Counts of delivered, hidden, invalid, duplicate and failed inputs.

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nordic-data/ssl-certificate-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/5VgkUyCebhRzgh35k/builds/nzvJXmA7FqrJI72Aj/openapi.json
