Skip to content

Renewing safely

The renewal service checks every hour. A certificate renews when its certificate authority says so, through ACME Renewal Information (ARI). Without that, it renews 30 days before expiry (set under Settings › General), or a third of its lifetime before expiry for shorter certificates, so a six-day certificate renews two days before it expires. Each order also tells the certificate authority which certificate it replaces.

Terminal window
SSLense.Cli status # each certificate, its expiry, and its next renewal
SSLense.Cli renew --all # renew every certificate that is due
SSLense.Cli renew --site "Shop" --force # renew now, due or not

In the app, Renew all due and a certificate's Renew now do the same. A renewal you start always runs at once.

SSLense imports the new certificate, changes the site's HTTPS bindings, and connects to the site over HTTPS to check it serves the new certificate. If it does not within 15 seconds, the previous bindings come back and the new certificate is removed. Settings on a binding, such as disabled HTTP/2, are kept.

Failed renewals are retried on a saved schedule, which survives restarts:

Failures in a row Next attempt
1 after 1 hour
2 after 2 hours
3 or more every 6 hours; hourly once the certificate is within 2 days of expiry
A rate limit after 24 hours, because retrying sooner only extends it

You are notified on the third failure and about once a day after that, and at once for a rate limit. Existing bindings stay as they are when a renewal fails.

In the app, a failing certificate is marked red in the list and shows the error on its Status tab. Fix the cause, then choose Renew now; Activity has the full log.

A certificate whose renewal failed: Let's Encrypt could not reach the site on port 80

Expiry is watched separately from renewal, so you are still told if renewal itself is broken. Each alert is sent once per certificate, at points that scale with its lifetime:

Alert 90-day certificate 45-day certificate 6-day certificate
Expires soon (a sixth of its lifetime, at most 14 days) 14 days left 7.5 days left 1 day left
Expires very soon (an eighteenth, at most 3 days) 3 days left 2.5 days left 8 hours left
Expired at expiry at expiry at expiry

To keep renewals, and the service restarts their deployment steps may do, out of working hours, set a window under Settings › General: tick Renew automatically only during a maintenance window, choose the days and hours, and choose Save maintenance window.

Settings, General: the maintenance window's days and hours, in server time

From the command line:

Terminal window
SSLense.Cli window set --days weekdays --from 1 --to 5 # server time; --from 22 --to 4 runs past midnight
SSLense.Cli window show
SSLense.Cli window off

A due renewal waits for the window, but never when the certificate is close to expiry: within 2 days, or a tenth of its lifetime, it renews at once. A renewal you start always runs at once.

Each certificate has a timeline on its History tab, or SSLense.Cli history --site "Shop": issued, renewed (with the certificate it replaced), renewal failed (with the error), rolled back and forward, revoked.

The History tab: the previous certificate that Roll back would bind again, then the timeline, newest first

If a new certificate breaks something, such as a client that pins the old key, or an old device that does not trust the new chain, go back:

  • ⋯ › Roll back to the previous certificate…, or Roll back… on the History tab;
  • or SSLense.Cli rollback --site "Shop".

SSLense keeps the certificate each renewal replaced, while it is valid, so it can bind it again. The newer one is kept in turn, so the same command goes forward again. After a rollback, automatic renewal waits for up to a week, so you have time to fix the cause.

A rollback is refused (SSL4055) when the previous certificate has expired or is about to, no longer covers the site's hosts, or was revoked.

A key or account that may have been copied

Section titled “A key or account that may have been copied”

If a certificate's private key may have been copied, for example from a stolen backup:

Terminal window
SSLense.Cli revoke --site "Shop" --yes

By default this installs a new certificate with a new key first, then revokes the old one, so no site serves a revoked certificate. In the app: ⋯ › Revoke and replace (key compromised)….

If the ACME account key may have been copied, replace it; certificates are not affected:

Terminal window
SSLense.Cli account change-key --ca letsencrypt --yes # the account for Let's Encrypt production

The runbook for a compromised key or account has the full steps.