Certificate expired, but certbot says not time for renewal

So here is a screen shot from Outlook showing expired certificate, but certbot response is showing not time for renewal.

My domain is: mail.lindows.org

I ran this command: certbot renew

It produced this output:

Cert not yet due for renewal
/etc/letsencrypt/live/mail.lindows.org-0001/fullchain.pem expires on 2020-11-10 (skipped)
Cert not yet due for renewal

My web server is (include version): nginix

The operating system my web server runs on is (include version): Debian 9

I can login to a root shell on my machine (yes or no, or I don’t know): yes

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): certbot 0.28.0

Could you show me what the contents of this file are:

/etc/letsencrypt/renewal/mail.lindows.org-0001.conf

Possibly, Certbot is not configured to automatically reload nginx upon certificate renewal.

2 Likes

Just what @_az said,
If you are running Nginx, to fix the issue for one single time please run sudo systemctl reload nginx.

To fix for all future renewals, please do what @_az suggested above.

1 Like

@_az & @stevenzhu

Actually, that is a new creation.

I ran certbot -d "mail.lindows.org" to see what would happen. I guess I should delete that

The actual output of renew on my second attempt was:

/etc/letsencrypt/live/mail.lindows.org-0001/fullchain.pem expires on 2020-11-10 (skipped)
/etc/letsencrypt/live/mail.lindows.org/fullchain.pem expires on 2020-10-11 (skipped)

This is what is in /etc/letsencrypt/live/mail.lindows.org/fullchain.pem

-----BEGIN CERTIFICATE-----
MIIFqzCCBJOgAwIBAgISA47+Yp635E81HN2Zi9IpsCGCMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0yMDA3MTMwNTEzMTRaFw0y
MDEwMTEwNTEzMTRaMBsxGTAXBgNVBAMTEG1haWwubGluZG93cy5vcmcwggEiMA0G
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDiMtGsePwHnDd7kNDn+8JgvP/v6DpG
4KY3znd6dVX4ZjOkYRlbC2Zs5AiXgxMrtAuGmD5jaAse+381cVpcEh9rc9Y/SyKC
iI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sudo systemctl reload nginx? Looks to me your certificate is renewed but nginx wasn’t asked to pickup the change.

2 Likes

What are the contents of /etc/letsencrypt/renwal/mail.lindows.org.conf, then?

Generally, one of two things need to happen:

  • The installer needs to be set to nginx so it automatically installs the certificate to the nginx configuration and reloads the server every renewal. That is typical if you used certbot --nginx. Or
  • The configuration contains a deploy hook, something along the lines of systemctl reload nginx, in the case that you originally used certbot certonly.

If neither is the case, that would explain why your certificate isn’t being reloaded upon renewal.

1 Like

@_az & @stevenzhu

I was able to resolve the issue. It seems I needed to do a server reboot.

I have symbolic links pointing to the Let’s Encrypt certificates which nginix is using, to the mail server wants to use. I guess the email server was still using old certificates. I guess they are held in memory?

Thanks for helping me understand this, and the quick, and helpful responses.

To save you from future issues (This will happen everytime you certificate renew), please do what @_az suggested so you won't need to reload nginx every 2 months.

I am using iRedMail for setup. The developer says to not to use the --nginx

I missed his caveat of

Let's Encrypt cert will expire in 90 days, you must renew it before expired. After renewed, don't forget to restart Postfix/Dovecot/Nginx/Apache to load the new cert files.

I guess I will just have to do daily reloads of those from cron

Thanks again.

That will work. You can alternatively put an executable shell script to reload everything inside the /etc/letsencrypt/renewal-hooks/deploy/ directory, which will be executed at every renewal.

2 Likes

That;s a great tip., and valuable info. Many thanks!

Curse Americans and their backwards mm/dd/yyyy dates.

The most likely problem is that your webserver and certbot are talking about two different certificates. Best case solution: reload the mailserver so it can realise the certificate has been renewed (and tell certbot to do it in the future by adding a --deploy-hook)

This means your command is:

certbot renew {whatewer plugin, or none to read from old runs} \
              --deploy-hook "systemctl reload postfix dovecot nginx apache"

:wink:

1 Like

Thanks for that tip!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.