# SSL Certificate Check: expiry, chain, SANs and TLS versions (`examsens.ai/ssl-certificate-check`) Actor

Checks the TLS certificate of many hosts at once: issuer, subject, SANs, validity dates, days to expiry, chain trust, host name match, key and signature, and which TLS versions from 1.0 to 1.3 the server accepts.

- **URL**: https://apify.com/examsens.ai/ssl-certificate-check.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $27.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 Check: expiry, chain, SANs and TLS versions

Give it a list of host names and it returns, for each one, the TLS certificate in full, whether its chain verifies to a trusted root, how many days it has left, and which TLS versions the server still accepts.

The actor reads the certificate even when it is expired, self-signed or issued for another name, so it reports a broken certificate in full. A second handshake then checks the chain and the host name against the Mozilla root store.

For each host you get:

- Issuer and subject: common name, organization, country and the full distinguished name
- Subject alternative names (SANs) and their count
- Valid from, valid to and days to expiry
- `chainValid`, and in `chainError` the reason when it fails: expired, self-signed, self-signed root in the chain, chain incomplete, or host name mismatch
- `hostnameMatches`, checked against the SANs with wildcard rules
- The negotiated TLS version and cipher, and the handshake time
- With "Test TLS versions" on, `protocols`: true or false for each of TLS 1.0, 1.1, 1.2 and 1.3
- Serial number, signature algorithm, public key type and size (with the curve for EC keys), SHA-256 and SHA-1 fingerprints, validation type (DV, OV or EV, from the certificate policy), OCSP, CA issuer and CRL URLs
- The chain the server sends, and the chain that verifies to a trusted root
- An `issues` list: expired, expiring within your warning window, name not covered, chain not trusted, self-signed, a SHA-1 signed intermediate, TLS 1.0 or 1.1 still accepted, and TLS 1.3 not supported

### Input

- Hosts (required). `example.com`, `www.example.com`, `host:port` and full URLs all work; the path is ignored and duplicates are checked once. IP addresses work too.
- Default port (default 443). Use 465, 993 or 995 for mail servers, or give the port with the host.
- Expiry warning in days (default 30)
- Test TLS versions (default on). Makes one extra handshake per version.
- Timeout per handshake (default 15 seconds) and hosts checked at once (default 10)

### Output

Dataset: one item per host with `input`, `host`, `port`, `ok`, `ip`, `tlsVersion`, `cipher`, `handshakeMs`, `chainValid`, `chainError`, `hostnameMatches`, `subject`, `issuer`, `subjectAltNames`, `sanCount`, `validFrom`, `validTo`, `daysToExpiry`, `certificate`, `presentedChain`, `verifiedChain`, `protocols`, `issues`, `issueCount` and `checkedAt`. A host that cannot be reached gets an item with `ok` false and the reason in `error`, such as a name that does not resolve or no TLS answer on the port. Export as JSON, CSV or Excel, or read it over the API.

### Pricing

Pay per event: one event per host whose certificate was read. Hosts that cannot be reached and entries that are not valid host names are reported and not charged.

### Scope and conduct

The actor makes TLS handshakes only. It sends no HTTP request and reads no page from the site.

### Support

Questions and problems: the Issues tab on this page.

# Actor input Schema

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

Host names to check, such as example.com or www.example.com. host:port and full URLs also work; the path is ignored. Subdomains are kept as given.

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

Port used when a host has none: 443 for HTTPS, 465 for SMTPS, 993 for IMAPS, 995 for POP3S.

## `warningDays` (type: `integer`):

Add an issue when the certificate expires within this many days.

## `probeTlsVersions` (type: `boolean`):

Make one extra handshake for each of TLS 1.0, 1.1, 1.2 and 1.3 to find which ones the server accepts.

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

How long to wait for each connection and handshake.

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

How many hosts are checked at the same time.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "expired.badssl.com",
    "smtp.gmail.com:465"
  ],
  "port": 443,
  "warningDays": 30,
  "probeTlsVersions": true,
  "timeoutSecs": 15,
  "maxConcurrency": 10
}
```

# 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 = {
    "domains": [
        "apify.com",
        "expired.badssl.com",
        "smtp.gmail.com:465"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/ssl-certificate-check").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",
        "expired.badssl.com",
        "smtp.gmail.com:465",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/ssl-certificate-check").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",
    "expired.badssl.com",
    "smtp.gmail.com:465"
  ]
}' |
apify call examsens.ai/ssl-certificate-check --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,examsens.ai/ssl-certificate-check"
        }
    }
}
```

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/8d6eFT4IpoZBeyn3T/builds/OgDin2t1Goabhh705/openapi.json
