Browsers not picking up new SSL certificate

My domain is: vestasit.com

My SSL certificates renewed and according the my litespeed server log, the server restarted but browsers don't pick up the new certificate.

If I manually restart the server on the command line then browsers pick up the new certificates. However, this has been going on for almost a year now and I can't SSH into the server every two months to manually restart it.

How can I make this work?

This is the 3rd thread I've made on this topic. Unfortunately, I never know if things are working until two months after I've made a change and the new certificate is issued, so this has been a very slow process.

For info on my server, versions, commands, please refer to the previous threads:

1st thread - I thought things were solved but turns out not to be so.

2nd thread - unresolved.

Please help. I have no idea what else to try.

1 Like

Current Certificate

certbot certificates

output:

Found the following certs:
Certificate Name: vestasit.com
Domains: vestasit.com www.vestasit.com
Expiry Date: 2021-03-16 09:09:45+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/vestasit.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/vestasit.com/privkey.pem

LSWS restart log

cat usr/local/lsws/logs/lsrestart.log

output:
...
Wed Dec 16 10:09:46 UTC 2020
reload, LSWS running: 0

1 Like

Hello :slightly_smiling_face:

Run the following command only once to update your certbot configuration to use the correct (reload) deployment hook.

sudo certbot certonly --cert-name vestasit.com --webroot -w /usr/local/lsws/vestasit.com/html -d "vestasit.com,www.vestasit.com" --deploy-hook "/usr/local/lsws/bin/lswsctrl reload" --force-renewal

You can test the renewal deployment hook using the following command. Warning: the command above and the following command will each acquire a new certificate. You are limited to acquiring 5 new certificates in any 7-day period.

sudo certbot renew --force-renewal

Your crontab at that point should only be running:

sudo certbot renew -q

3 Likes

Thank you for the detailed response! I will try what you recommended.

I'm just curious though, why it's not working currently? As far as I can tell the certificate renews exactly when expected and the server restarts. So why are the browsers not picking up the new certificate?

3 Likes

Turns out this directory /usr/local/lsws/vestasit.com/html doesn't exist. There's no directory with my domain name inside usr/local/lsws/. May I ask what is supposed to be in there?

2 Likes

That was my assumption of the webroot directory of your website based on the standard documentation. Substitute the proper webroot directory accordingly.

The default is usually:

/usr/local/lsws/DEFAULT/html

3 Likes

I'm very inexperienced with all of this. How do I figure out what my webroot directory is?

2 Likes

It's the directory where your website content is located.

2 Likes

Ok, I think I found it at /var/www/html

I used that path and the certificated did renew and was picked up by browsers. I will check again in two months to see if the browsers pick up the next renewal without issue.

Either way, thank you for all your help @griffin!

2 Likes

:partying_face:

Glad to hear it!

2 Likes

Just writing to keep this thread open for another 30 days so that I can let the community know if the above solution worked. Need to wait for the auto renewal to run again,

2 Likes

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

The SSL cert is now less than 30 days from expiring and this time it has not renewed.

Here is the output from certbot certificates:

Found the following certs:
Certificate Name: vestasit.com
Domains: vestasit.com www.vestasit.com
Expiry Date: 2021-03-20 20:37:18+00:00 (VALID: 27 days)
Certificate Path: /etc/letsencrypt/live/vestasit.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/vestasit.com/privkey.pem

To recap, previously my cert was renewing and the server was restarting but the changes were not being picked up by browsers. Now, the cert is not renewing.

What do I do now?

2 Likes

What's the output of sudo certbot renew now?

3 Likes

I did a dry run as I don't want to renew the certificate until I make another attempt to fix this. Every time I think I've found the solution I have to wait 2 months to see if it actually worked. So if I renew the certificate with sudo certbot renew then I'll have to wait 2 months to see if any changes I make work. Therefore I used the following command:

sudo certbot renew --dry-run

output:

Processing /etc/letsencrypt/renewal/vestasit.com.conf


Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for vestasit.com
http-01 challenge for www.vestasit.com
Cleaning up challenges
Attempting to renew cert (vestasit.com) from /etc/letsencrypt/renewal/vestasit.com.conf produced an unexpected erro
r: Missing command line flag or config entry for this setting:
Input the webroot for vestasit.com:. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/vestasit.com/fullchain.pem (failure)


** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates below have not been saved.)
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/vestasit.com/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
** (The test certificates above have not been saved.)


1 renew failure(s), 0 parse failure(s)

VERY INTERESTING. I've never received an error before. Looks like I have the wrong webroot? But I have no idea how or what I need to change.

My webroot, I'm fairly certain, is in /var/www/html which is what appears in my certificat renewal config file.

Here is the content of /etc/letsencrypt/renewal/vestasit.com.conf :

renew_before_expiry = 30 days

version = 0.31.0
archive_dir = /etc/letsencrypt/archive/vestasit.com
cert = /etc/letsencrypt/live/vestasit.com/cert.pem
privkey = /etc/letsencrypt/live/vestasit.com/privkey.pem
chain = /etc/letsencrypt/live/vestasit.com/chain.pem
fullchain = /etc/letsencrypt/live/vestasit.com/fullchain.pem

Options used in the renewal process

[renewalparams]
account = [account number]
authenticator = webroot
server = https://acme-v02.api.letsencrypt.org/directory
renew_hook = /usr/local/lsws/bin/lswsctrl reload
webroot_path = /var/www/html,
[[webroot_map]]

So what am I supposed to do now?

2 Likes

Your configuration file seems to be missing the webroot path or it's malfunctioning. Renew does not allow interactive input, so it skipped letting you enter the webroot path.

2 Likes

Let's look at something first...

sudo ls -lRa /etc/letsencrypt

2 Likes

It's a very large output. Would you like me to post the whole thing?

2 Likes

Yes, please post it all.

2 Likes