Skip to content

Daily

Get warned before an SSL certificate expires

Your sheet of domains shows how many days each certificate has left, and you get an email when any drops under 14 days.

Runs
Daily
Apps
Gmail, Google Sheets
AI
Not needed
Access
Sheets read+write; Gmail gmail.send

Send this to your assistant

Create a ClickRuntime automation: every day, check the SSL certificates of the domains in my sheet, update the days left, and email me any under 14 days.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

An agency manages websites for twenty clients. Most certificates renew on their own, but one is on an old server, another was bought separately by the client years ago. When one of them lapses, visitors see a browser warning saying the site is not secure, and the client's phone starts ringing.

This automation checks every certificate daily and gives you two weeks' notice, so expiring certificates are renewed calmly instead of after the warning has appeared.

What you get out of it

  • No surprise security warnings

    Renewing before expiry means visitors never see the full-page warning that drives them away from a site.

  • Catches the certificates that do not renew themselves

    Manual certificates, old servers and client-owned domains are exactly the ones that slip. A daily check covers them all.

  • One place to see every domain

    The sheet shows days left for each site at a glance, which is handy when planning work or talking to clients.

  • Quiet until it matters

    You only get an email when a certificate is close to expiry, so the alert means something when it arrives.

How it works

What happens, step by step

  1. Every day ClickRuntime reads the list of domains from your sheet.

  2. It connects to each domain and reads the expiry date of its certificate.

  3. It writes the number of days left next to each domain in the sheet.

  4. If any certificate has fewer than 14 days left, it emails you the list from your Gmail account.

Before it runs live

  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
  • Connect your Google Sheets account and pick the spreadsheets it may use

What you get

RunsDaily
Get warned before an SSL certificate expirestoday, 9:00Succeeded
Email · SSL alert2 SSL certificates need attention shop.northwind.example: 9 days, acme-clinic.example: unreachable

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Gmail and Google Sheets steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
ssl_certificate_expiry_alerts.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import base64, socket, ssl
from datetime import datetime, timezone
from email.mime.text import MIMEText
from clickruntime import on_trigger, credentials

SHEET_ID = "your-spreadsheet-id"

def days_left(host):
    with ssl.create_default_context().wrap_socket(socket.create_connection((host, 443), timeout=10), server_hostname=host) as s:
        exp = datetime.strptime(s.getpeercert()["notAfter"], "%b %d %H:%M:%S %Y %Z").replace(tzinfo=timezone.utc)
    return (exp - datetime.now(timezone.utc)).days

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    sheets = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets()
    hosts = [r[0] for r in sheets.values().get(spreadsheetId=SHEET_ID, range="Domains!A2:A").execute().get("values", []) if r]
    out, soon = [], []
    for h in hosts:
        try:
            d = days_left(h)
        except Exception:
            d = "unreachable"
        out.append([d])
        if d == "unreachable" or d < 14:
            soon.append(f"{h}: {d}")
    sheets.values().update(spreadsheetId=SHEET_ID, range="Domains!B2", valueInputOption="RAW", body={"values": out}).execute()
    if soon:
        msg = MIMEText("\n".join(soon))
        msg["to"], msg["subject"] = "you@example.com", f"{len(soon)} SSL certificate(s) need attention"
        build("gmail", "v1", credentials=creds, cache_discovery=False).users().messages().send(
            userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
    return {"checked": len(hosts), "alerts": len(soon)}

FAQ

Common questions

Can I change the 14-day warning?
Yes. Any number of days works, and some people use two thresholds, such as a first notice at 30 days and a reminder at 7.
Does it check subdomains?
It checks exactly the host names listed in the sheet. Add each subdomain you care about, such as shop.example.com, as its own row.
What if a domain cannot be reached?
The row is marked as unreachable and included in the email, since a site that cannot be checked may have a bigger problem.
What permissions does it need?
Sheets read+write; Gmail gmail.send. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get warned before an SSL certificate expires” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.