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.
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
Every day ClickRuntime reads the list of domains from your sheet.
It connects to each domain and reads the expiry date of its certificate.
It writes the number of days left next to each domain in the sheet.
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
Build your own
Need it to work differently?
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
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?
Does it check subdomains?
What if a domain cannot be reached?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Copy a table from a web page into a sheet every morning
Each morning the listings on a page you choose are added to your Google Sheet, and you get the same rows by email as a CSV.
See how it worksMonitor websites from a sheet with email alerts
You get an email when a site in your sheet goes down, and every outage is logged in the same sheet.
See how it worksGet an email when a product drops below your target price
The products in your sheet are checked every 6 hours, each price is logged, and you get an email when one falls below your target.
See how it worksKeep exploring
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.