Skip to content

TLS certificate expiry (tls_cert) ​

Completes a TLS handshake and reports the days until the server's certificate expires, and the earliest expiry among all certificates the server sent. The certificate is read even when it is untrusted: this sensor judges the dates, not the trust chain.

When to use it ​

For a website, use http_status or http_content with https: they report the same two values (as cert_days_remaining and chain_days_remaining, with the same limits) from the connection of their own request, so one sensor watches the site and its certificate and one certificate does not page twice. The web server template no longer proposes a separate tls_cert for port 443.

Use tls_cert for TLS services that are not HTTP, such as SMTPS (465), IMAPS (993), POP3S (995), LDAPS (636) or any other service that speaks TLS directly on its port; for a web interface you only want the certificate of (the Proxmox VE template uses it for port 8006); and where an HTTPS check would fail its handshake because the certificate is not trusted and you would rather neither pin it nor turn verify_tls off.

Channels ​

KeyNameUnitDefault limits
days_remainingDays until the certificate expiresdayswarning below 21, error below 7
chain_days_remainingDays until the earliest expiry in the chaindayswarning below 21, error below 7

An expired certificate gives a negative value. A certificate that is not valid yet reports the days until it becomes valid, negated.

Parameters ​

ParameterDefaultMeaning
port443TCP port of the TLS service.
server_namethe device's host name, if it has oneName to send as SNI. Must not be empty or contain spaces.

Suggested interval: 3600 seconds. No credential.

On the target ​

A service that speaks TLS directly on the port (not STARTTLS). If the server picks its certificate by name, the device needs a host name or you must set server_name.

Failures ​

MessageMeaning
TLS handshake with ... failed (kind protocol)The service does not speak TLS on that port, or refused the handshake.
a timeout (kind timeout)The handshake did not finish inside the poll timeout.
the server presented no certificate, the server's certificate could not be parsedThe server answered oddly.
certificate for ... expired N days ago, ... is not valid for another N days, a certificate in the chain ... has expiredA successful poll that is Down. Renew the certificate or fix the chain the server sends.

AGPL-3.0-only