How to solve "unauthorized" error with Certbot

My site was running correctly for a few months and when I tried to renew my SSL certificate through certbot I am getting this error. Droplet: Litespeed Domain from: Cloudflare Domain:


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


In order for Let’s Encrypt to issue a valid SSL certificate, it needs to validate your domain name. For that to happen your domain needs to be pointing to the server IP address directly.

In your case, as you are using Cloudflare, the public A record for your domain name will not match the server IP but it would match Cloudflare’s IP address.

There are two solutions to this:

  • Disable the proxy in Cloudflare and set the A record to DNS only. This can be done via the DNS zone manager in your Cloudflare.
  • Alternatively, you could just keep using Cloudflare and not use Let’s Encrypt as Cloudflare provides you with an SSL certificate already. You would only need to set your SSL type in Cloudflare to Flexible.

Hope that this helps. Best, Bobby