
If everyone fails on the same day, it is the server certificate or the CRL nine times out of ten. If one person fails, it is their own.
Certificates do not fade; at one second everybody is out, and whoever signed them may have left. Two parts: the quickest recovery, and how to avoid it.
Which one
| Log | Expired |
|---|---|
depth=0, CN=server with expired | Server certificate |
CN=laptop expired in the server log | That client's |
depth=1 expired | CA |
CRL has expired | Revocation list |
| not yet valid | Somebody's clock is slow |
openssl x509 -in server.crt -noout -enddate
openssl crl -in crl.pem -noout -nextupdate
The revocation list
The saddest case: all certificates are fine. Make a new one and copy it:
./easyrsa gen-crl
scp pki/crl.pem root@server:/etc/openvpn/server/The server certificate
Sign again, replace server.crt and server.key, restart. Clients need no change; they trust the issuer.

A client certificate
Issue one under a new name, hand over the new .ovpn, and revoke the old.
The issuer
The worst: everything is reissued. Start half a year early. Make a new CA and put both CA certificates into the server's ca.crt, so that old and new papers are accepted, and take the old one out when everyone has changed.
- CalendarServer 825 days, CRL 180 days
- Monthly
./easyrsa show-expire 60 - CRL on a scheduleAs a scheduled job
How far does it reach
- EverybodyServer certificate, CRL or CA
- Only new connectionsThe same; hurry, reconnects will fail
- One personTheir own
If one connection into the server is still open, keep it.
Emergency
CRL: five minutes. If the signing machine cannot be found, comment out crl-verify and restart; revoked certificates then work too, so repair it the same day.
Server certificate, with the CA key:
./easyrsa --days=825 build-server-full server2 nopass
openssl x509 -in pki/issued/server2.crt -noout -subject -enddateUse a new name, keep the old files, change two lines and restart. If clients check verify-x509-name, the name has to stay.
CA: no shortcut. Start a second service on another port with a new CA, hand out new profiles, let people move over.
The CA key is lost
Then nothing can be signed and all is rebuilt. Before giving up look on old computers, backup drives, /etc/openvpn/easy-rsa/pki/private/ and root's home directory.
A warning in time
#!/bin/sh
D=/etc/openvpn/server
for f in $D/server.crt $D/ca.crt; do
openssl x509 -in $f -noout -checkend 2592000 || echo "$f expires within 30 days"
done
N=$(openssl crl -in $D/crl.pem -noout -nextupdate | cut -d= -f2)
[ $(( ($(date -d "$N" +%s) - $(date +%s)) / 86400 )) -lt 30 ] && echo "crl.pem expires within 30 days"Run it weekly and send the output to mail or a chat. For clients ./easyrsa show-expire 60.
How long
| Certificate | Suggestion |
|---|---|
| CA | Ten years, key offline |
| Server | About two years |
| Client | One or two |
| CRL | 180 days, renewed automatically |
A hundred years saves work, and keeps lost devices and former staff valid.
What clients need
New server certificate, same CA: nothing. New CA or new tls-crypt key: everybody. Test a new profile on one device first.
Can I set my clock back?
It works for a moment, but web certificates all fail and the server may refuse. Do not.
A provider's profile expired?
Download a new one from their website.
It says expired but the certificate is fine?
Look at that device's clock.
Can a certificate be extended?
Only signed again; renew does the same.
A provider's certificate expired?
Download a new profile, or ask support.



