It starts the same way every time. Something stops working and nobody changed anything. Users get a browser warning, an API starts rejecting connections, a service that talks to another service logs certificate verify failed, and the first hour of guessing is spent on everything except the certificate.
If you’re reading this mid-incident, skip down to step 1 and work through it. If you’re reading it on a quiet day, copy it somewhere your team will find it at 3 a.m. Every command below was run against test certificates, including an expired one.
1. Confirm it’s the certificate
Don’t assume. Ask the server what it’s presenting and whether the client trusts it. The -verify_return_error flag makes s_client stop on verification errors instead of carrying on, which the OpenSSL docs point out is not its default behavior:
openssl s_client -connect app.example.com:443 -servername app.example.com -verify_return_error </dev/null 2>&1 | grep -E "Verif|verify error"
An expired certificate looks like this:
verify error:num=10:certificate has expired
Verification error: certificate has expired
Verify return code: 10 (certificate has expired)
If you see unable to get local issuer certificate instead, that’s a different problem: the client doesn’t trust or can’t build the chain to the issuer. In my own test it showed up because the test CA wasn’t in the trust store. Expired and untrusted look similar to a user and need different fixes, so read the line.
To see the dates directly:
openssl s_client -connect app.example.com:443 -servername app.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -dates
2. Find out which certificate, and where else it lives
Say it’s app.example.com. Before you touch anything, answer two questions: what exactly is serving this name, and where else is the same certificate installed?
The first is often a surprise. The name might terminate at a load balancer or reverse proxy rather than the app server, and the certificate on the app server behind it might be fine. Check each hop. Use -showcerts to see what the server sends. The docs are careful to say this is the list as sent by the server, not a verified chain:
openssl s_client -connect app.example.com:443 -servername app.example.com -showcerts </dev/null 2>/dev/null | grep -E "^ *[0-9]+ s:|^ *i:"
The second question is where outages repeat themselves. The same certificate is often installed on a load balancer, two app servers and a monitoring tool. Fix one and the others expire on the same day. If you have a record of where certificates live, now is when you need it. If you don’t, that’s what certificate discovery is for, and I’d put it on the follow-up list.
3. Get the replacement certificate
How you do this depends on who issued it. If it came from your internal CA, request a new one from the same template. If it came from a public CA or an ACME client, run the renewal. Either way, you want the new certificate, any intermediate certificates your server needs to send, and the private key.
The key question matters. If you generated a new key with the new request, the new certificate matches the new key. If you reused the old key, it matches the old one. Don’t guess, check it before you install anything. These two commands print a hash of the public key from the certificate and from the key file, and the hashes must be identical:
openssl x509 -in new.crt -noout -pubkey | openssl sha256
openssl pkey -in new.key -pubout | openssl sha256
Also confirm the dates and names before it goes anywhere near production:
openssl x509 -in new.crt -noout -subject -dates -ext subjectAltName
If the SAN list is missing a name your users connect with, you’ve just swapped one outage for another.
4. Install it and reload the service
Put the new certificate, with the intermediates, and key where the service expects them, then reload. For nginx, the sequence is a config test followed by a graceful reload:
nginx -t && nginx -s reload
nginx’s documentation describes the reload (a HUP signal to the master process) as checking the new configuration first, rolling back and carrying on with the old one if it fails, and otherwise starting new workers while the old ones finish serving their current clients. That’s a good property in the middle of an incident: if you made a typo, the old configuration keeps running. Other services have their own commands. On Windows with IIS, you rebind the certificate to the site and confirm the binding took.
Keep a copy of the old files before you replace them. It costs nothing, and it’s your rollback.
5. Verify from the outside
Don’t trust the reload. Ask the server what it’s presenting now, and compare it to the file you meant to install:
openssl s_client -connect app.example.com:443 -servername app.example.com </dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256
openssl x509 -in new.crt -noout -fingerprint -sha256
The fingerprints should match. If they don’t, the service is still serving the old certificate, a very common reason an outage “isn’t fixed” after a renewal. Maybe the reload didn’t happen, maybe there’s a second listener, or maybe a load balancer is still holding the old one. Run the verify command from step 1 again too, and this time you want a clean Verify return code: 0 (ok).
Then check the other places from step 2, and the clients. Some applications cache certificates or pin them, and need a restart or a trust update on their own.
6. Make sure it doesn’t happen again
The fix isn’t done when the page comes back. Write down three things while it’s fresh: which certificate it was and who owned it, how the replacement was done (the exact steps, so the next person doesn’t have to work it out), and how you almost found out earlier. Then close the loop. Either a monitoring check with an alert that reaches a human, or at minimum a calendar item for the next renewal that someone other than you will see.
If you want the numbers to make the case to whoever signs off on that, the hidden costs of certificate outages walks through what an outage really costs, and 5 companies crushed by certificate outages shows this isn’t just a small-shop problem.
Where CertMS fits
The runbook above is what you do after the expiry. CertMS is aimed at the first, quiet part: knowing about the certificate before it lapses. It monitors your Windows CA, Windows and Linux servers and URLs, and it records which servers each certificate lives on, which is the answer to step 2. You can write your own replacement steps and attach them to a certificate, so the instructions in step 3 and 4 are waiting in the alert. Help desk tickets or webhooks fire a set number of days before expiry. It’s a monitoring tool, not a replacement for the CA or your deployment process; someone still has to do the renewal. If you’d like to see how it compares with the spreadsheet-and-calendar approach, there’s manual tracking vs. CertMS, or take a look at CertMS.