# SSL Certificate Checker - Expiry, Chain & Security Headers (`hardreset83/ssl-certificate-checker`) Actor

Check SSL/TLS certificates of many websites at once: days to expiry, trust and chain, TLS 1.3 and old TLS 1.0/1.1, HTTPS redirect, HSTS and security headers. Grade A-F, alerts and an Excel report.

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

## Pricing

$3.00 / 1,000 site 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 security headers)

Check the SSL/TLS certificates of one website or thousands at once and never get caught by an expired
certificate again. For every site you get the **days left before expiry**, whether **browsers trust** the
certificate (and why not), the **chain**, the **TLS version**, old **TLS 1.0/1.1** still switched on, the
**HTTP to HTTPS redirect**, **HSTS** and the **security headers**, with a **grade from A to F** and a fix for each
problem. Results come as a table, JSON, a ready **REPORT.xlsx** sorted by expiry and an **ALERTS** list.

Certificates are getting shorter: since March 2026 a public certificate lasts at most 200 days, from March 2027 at
most 100 days and from 2029 only 47 days. Renewals happen more and more often, and one that silently fails takes
the site down with a browser warning. A weekly run of this Actor catches it in time.

### What it checks

- **Certificate**: common name and all names (SAN), issuer, valid from/to, **days left**, lifetime, key type and
  size (RSA, ECDSA), signature hash, serial number, SHA-256 fingerprint, self-signed.
- **Trust**: the same checks a browser makes (expired, not yet valid, wrong name, unknown authority, missing
  intermediate certificate), with the reason in plain words.
- **Chain**: each certificate the server sends, with its expiry date.
- **TLS**: the version used (TLS 1.3 or 1.2), the cipher, and whether the obsolete TLS 1.0/1.1 are still accepted.
- **HTTPS setup**: does http:// redirect to https://, the final URL and status code of the home page.
- **HSTS**: present, max-age, includeSubDomains, preload.
- **Security headers**: Content-Security-Policy, X-Content-Type-Options, X-Frame-Options (or frame-ancestors),
  Referrer-Policy, Permissions-Policy; the Server and X-Powered-By headers that reveal software versions; cookies
  without the Secure flag.

### Who is it for

- **Web agencies and freelancers**: one scheduled run for all client sites, with the report to send.
- **MSPs and IT teams**: monitor certificates on public sites, shops, portals and APIs.
- **SEO and marketing teams**: an expired certificate or a missing HTTPS redirect costs traffic and trust.
- **Security and compliance**: a quick posture check across a whole list of domains.
- **Developers, automations and AI agents**: clean JSON, works with Make, Zapier, n8n, webhooks and the Apify API.

### How to use it

1. Paste domains or URLs in **Websites**, or upload a TXT/CSV file. The input is prefilled with two sites: press
   **Start** to see the result.
2. Choose how many days before expiry you want to be warned (default 30).
3. Open the **Storage** tab: **REPORT.xlsx** (sheets *Sites* and *Issues*), **ALERTS** (only the certificates
   that are invalid or expire soon) and **SUMMARY**. Or export the dataset in any format.

**Monitoring**: save the input as a **task**, add a **schedule** (for example every Monday) and connect an email,
Slack or webhook integration to get the alerts automatically.

### Example output

```json
{
  "host": "shop.example.com",
  "port": 443,
  "status": "ok",
  "grade": "B",
  "score": 88,
  "certificateValid": true,
  "daysLeft": 17,
  "expiresOn": "2026-12-01",
  "expiringSoon": true,
  "issuer": "Let's Encrypt",
  "commonName": "shop.example.com",
  "subjectAltNames": ["shop.example.com", "www.shop.example.com"],
  "keyType": "EC secp256r1 256",
  "signatureHash": "sha384",
  "lifetimeDays": 90,
  "tlsVersion": "TLSv1.3",
  "legacyTls": false,
  "chain": [{"subject": "shop.example.com", "issuer": "E7", "expiresOn": "2026-12-01"}],
  "httpsRedirect": true,
  "hsts": true,
  "hstsMaxAge": 31536000,
  "missingHeaders": ["Permissions-Policy"],
  "issuesCount": 1,
  "topIssue": "The certificate expires in 17 days (2026-12-01)",
  "issues": [{"severity": "warning", "area": "Certificate", "issue": "The certificate expires in 17 days (2026-12-01)",
              "fix": "Renew it, or check that automatic renewal works"}]
}
```

### Grades

Every site starts from 100: an expiring certificate, old TLS, no TLS 1.3, no HTTPS redirect, no HSTS, missing
security headers, revealed software versions and insecure cookies take points off. A: 90 and up, B: 80, C: 70,
D: 60, F: below 60. A certificate that browsers do not trust is always **F**.

### Pricing

**Pay per event: $3 per 1,000 sites checked** ($0.003 per site). You pay only when a certificate was read: names
that do not resolve, closed ports, timeouts and duplicates are free. Set a maximum cost per run in the run options
if you like.

### FAQ

**Is it safe and legal to run on any site?** It does what a browser does when it opens the home page: one TLS
connection to read the certificate, one test connection with the old TLS versions and one request for the home page
headers (the page body is not downloaded). No scanning, no attacks, no login.

**Does it work with other ports?** Yes: write `example.com:8443`. The HTTP redirect test runs only for port 443.

**Why does a site show "certificate not trusted" when my browser opens it?** Usually the server does not send the
intermediate certificate: some browsers fill the gap from their cache, other clients (apps, APIs, older phones)
fail. The issue says exactly what is missing.

**Can AI agents use it?** Yes: through the Apify API or the Apify MCP server, an agent can check sites and read the
JSON.

# Actor input Schema

## `sites` (type: `array`):

Domains or URLs, one per line (example.com, https://shop.example.com, example.com:8443). The www and other subdomains are checked as written: they can have their own certificate.

## `sitesFile` (type: `string`):

A TXT or CSV file with domains or URLs in any column.

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

Certificates that expire sooner are flagged as expiring soon and listed in ALERTS.

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

Opens the home page like a browser (headers only, the page body is not downloaded) and checks the HTTP to HTTPS redirect, HSTS, Content-Security-Policy, X-Frame-Options and the other security headers.

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

Tries one connection with the old protocols that browsers dropped in 2020.

## `saveSpreadsheets` (type: `boolean`):

A ready Excel file sorted by days to expiry, with grades in color and an Issues sheet with the fix for each problem.

## `maxSites` (type: `integer`):

Stop after this many sites (0 = no limit). You can also set the maximum cost per run in the run options.

## Actor input object example

```json
{
  "sites": [
    "apify.com",
    "example.com"
  ],
  "warnDays": 30,
  "checkHeaders": true,
  "checkLegacyTls": true,
  "saveSpreadsheets": true,
  "maxSites": 0
}
```

# Actor output Schema

## `sites` (type: `string`):

Every site with its certificate, expiry, chain and security headers.

## `report` (type: `string`):

REPORT.xlsx: every site and every problem.

## `files` (type: `string`):

Every file of this run in the key-value store, with its link.

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

The result of the run in short: counts, totals, problems and the links to the files.

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

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

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

```

## MCP server setup

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