Skip to content

Instantly share code, notes, and snippets.

@cruzgo92
Last active March 17, 2021 01:20
Show Gist options
  • Select an option

  • Save cruzgo92/362c47674b4c75f169d5d62810e1007d to your computer and use it in GitHub Desktop.

Select an option

Save cruzgo92/362c47674b4c75f169d5d62810e1007d to your computer and use it in GitHub Desktop.
[FIX] SSL mismatch using Certbot on Apache2
# If receiving a certificate mismatch from webserver, delete and reinstall certificates as follows
///////////////Delete Certbot Certs/////
#list all SLL certificates issued by certbot
sudo certbot certificates
sudo certbot delete --cert-name yourdomain.com
# Second best if first does not work is to manually find the path to the fullchain certificate you wish to delete/remove
certbot revoke --cert-path /etc/letsencrypt/live/... #path to the cert
certbot delete --cert-name yourdomain.com
#delete the apache ssl conf for your domain
rm -Rf /etc/apache2/sites-available/000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on
sudo apache2ctl restart
#follow the guide to reinstall the certificate
///////////////Reinstall Certs/////
sudo certbot --apache -d yourdomain.com
# For Full SSL implementation using Certbot on Ubuntu
# Please follow article on DigitalOcean at
# https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment