Expired SIP TLS certificate
A certificate is only valid between two dates, its notBefore and notAfter fields. When a SIP client connects over TLS it compares those dates with its own clock, and if the current time falls outside that window it closes the connection. This applies to any SIP server that presents a certificate, whether it is a PBX, an SBC, a proxy or a provider's edge.
Expiry is unforgiving because it hits every peer at the same moment. Trunks that were fine a minute earlier refuse to connect, phones that register over TLS drop off at their next refresh, and new calls fail before a single SIP message is exchanged. The mirror case, a certificate that is not yet valid, usually points to a wrong clock or a certificate installed before its start date.
Error messages you may see
certificate has expiredcertificate is not yet validx509: certificate has expired or is not yet validremote error: tls: expired certificate
Common causes
- The renewal date was tracked by hand, and a one-year certificate ran out while nobody was watching.
- An automated renewal wrote the new certificate to disk, but the SIP service never reloaded it and still presents the old one.
- Only one node of a cluster or HA pair got the new certificate, so calls fail whenever DNS or a load balancer sends a peer to the other node.
- An intermediate certificate in the installed bundle expired before the server certificate did, which peers report as an expiry one level up the chain.
- The clock on the server or on the peer is wrong, often because NTP is blocked, so a valid certificate looks expired or not yet valid.
How to fix it
- Read the dates the server actually presents over the network, rather than those of the file you think it loads.
- Renew the certificate with your CA and install it together with its current intermediate, not the server certificate alone.
- Reload the TLS listener of the SIP service, then close long-lived TLS connections so peers reconnect and see the new certificate.
- Repeat the installation on every server behind the same name, and check each one by its own address.
- Turn on NTP on the SIP server and confirm its clock before installing a certificate whose start date is close.
Platform notes
- Microsoft Teams Direct Routing: After renewing the SBC certificate, Microsoft says to remove the TLS connections opened with the old one and re-establish them, for example by restarting the SBC in a quiet period.
- Kamailio: The tls.reload RPC command re-reads tls.cfg but not modparam() settings, and connections already open keep the old certificate until they close.
How the free check shows it
The Dates row of the free check fails with "Expired on" or "Not valid until" and the date, and warns once 30 days or fewer are left. On a monitored TLS Route, PingVo reads the certificate at least once an hour and by default alerts you 30, 14 and 7 days before it expires, and again if it does.
Questions
Why did every trunk fail at the same moment?
Each peer checks the same end date against its own clock. Once that date passes, every new TLS connection is refused at once, which can look like a network outage until someone reads the certificate.
I installed the new certificate. Why do peers still see the old one?
The service may not have reloaded it, another server behind the same name may still have the old file, or a peer is reusing a TLS connection opened before the change.
Does an expired certificate cut calls that are already up?
Usually not. The certificate is checked when a connection opens, so calls on an existing connection carry on while new ones fail.