Skip to main content
+44 7575 472931[email protected]
HostaccentKnowledge BaseHosting, websites, SEO, and growth

Certbot The Client Lacks Sufficient Authorization: 2026 Fix

Certbot the client lacks sufficient authorization? Fix the challenge 404, Cloudflare proxy, stale AAAA record or bad redirect and get your SSL issued today.

SecurityCloudflareVPS
Certbot the client lacks sufficient authorization error traced through Cloudflare, a stale AAAA record and the ACME webroot

Every certbot the client lacks sufficient authorization error comes down to one failed handshake. Let's Encrypt asked your domain for a tiny proof file over port 80, and something other than that file came back: a 404, a 403, a Cloudflare page, or a different server entirely.

Quick Answer: Put a test file in /.well-known/acme-challenge/ and fetch it with curl from outside the server. If you don't get the file back, fix whatever answered instead. As of November 2026, the culprit is almost always one of five things: the wrong webroot, a stale A or AAAA record, a Cloudflare proxy setting, a redirect, or a firewall. Certbot itself is rarely broken.

Last verified: November 2026: Certbot 5.9.0, Let's Encrypt ACME v2 (RFC 8555), HTTP-01 and DNS-01 challenge rules

Our team resolves 20-30 client issues every day, and failed SSL issuance is a regular in that queue, so this guide follows the exact order of checks our engineers use. If only a scheduled renewal breaks, see fixing Certbot renewal failures instead.

What Certbot The Client Lacks Sufficient Authorization Actually Means

It means Let's Encrypt could not confirm you control the domain through the HTTP-01 challenge. Certbot wrote the token file to /.well-known/acme-challenge/; the check from the internet is what failed.

As of November 2026, Let's Encrypt fetches every HTTP-01 token over port 80 from multiple network locations, follows at most 10 redirects, and accepts redirects only to port 80 or 443, per the Let's Encrypt challenge types documentation. If a required location gets a 404, a 403, a timeout or the wrong content, the Let's Encrypt challenge failed and no certificate is issued.

Read the detail line before you change anything

Certbot logs this as urn:ietf:params:acme:error:unauthorized, the "certbot unauthorized" error, and the text after "Invalid response from" tells you where to look.

What the detail line showsWhat it usually meansJump to
404 (the classic ACME challenge 404)File not where the CA lookedCause 1
403A deny rule, WAF or auth blocked itCauses 1 and 3
HTML, or "key authorization file did not match"Another server answeredCause 2
IP starting 2606:4700:, 104.16-104.27 or 172.64-172.71Request hit CloudflareCause 3
Timeout during connectPort 80 filtered somewhereCause 5
"Account creation on ACMEv1 is disabled"Ancient CertbotStill not working

The 5 Causes, Ranked by How Often We See Them

These are configuration problems between DNS and your web server, not Certbot bugs. Check them in this order:

  1. The challenge path isn't served: wrong webroot, wrong vhost, an app router or a dotfile deny rule.
  2. DNS points elsewhere: a stale A record, or an AAAA record your server doesn't answer on.
  3. Cloudflare sits in the middle: Always Use HTTPS, a WAF rule, or an origin not ready on 443.
  4. A redirect leaves the rails: another port, another host, or a broken HTTPS origin.
  5. A firewall drops some requests: usually country blocking.

According to Hostaccent's support queue, where engineers handle 20-30 client issues a day, causes 1 and 2 make up the clear majority of these tickets, and the actual fix usually takes under 15 minutes once you know which layer answered.

Pro Tip: Check the IP in brackets in the error. If it isn't your server's, stop editing your web server config. The CA never reached it.

Professional help available

Still blocked at Cloudflare?

Send the error code, affected hostname, and recent DNS or SSL changes. We will separate edge, origin, firewall, and certificate causes before proposing work.

Request Cloudflare helpExplore Cloudflare supportHosted elsewhere? One-time paid support is available after scope and price confirmation.

Step-by-Step Fixes for Each Cause

Run one quick test to identify your cause, then jump straight to that fix. Each fix below takes 5-15 minutes on a typical single-site server, and testing first stops you burning your 5 hourly retries on guesses.

The Four-Curl Test: find out what actually answers

Our engineers run this first on any authorization failure. Create a probe file in Certbot's webroot, then fetch it four ways from a machine outside the server (curl on the server can hit localhost via /etc/hosts and lie to you).

bash
# On the server
sudo mkdir -p /var/www/example.com/.well-known/acme-challenge
echo ok | sudo tee /var/www/example.com/.well-known/acme-challenge/probe

# From your own computer
curl -4 -i http://example.com/.well-known/acme-challenge/probe   # 1. public DNS, IPv4
curl -6 -i http://example.com/.well-known/acme-challenge/probe   # 2. public DNS, IPv6
curl -i --resolve example.com:80:203.0.113.10 \
  http://example.com/.well-known/acme-challenge/probe            # 3. straight to origin
curl -L -i http://example.com/.well-known/acme-challenge/probe   # 4. follow redirects

Use your server's IPv4 for 203.0.113.10. If test 3 fails, go to Cause 1. If 3 works but 1 or 2 fails, DNS or a proxy is at fault (Causes 2 and 3). If only test 2 fails, it's your AAAA record. If test 4 ends somewhere odd, see Cause 4. All four pass? Cause 5.

Cause 1: The challenge file isn't being served

Confirm which document root the port-80 site really uses:

bash
sudo nginx -T | grep -E "server_name|root|listen"
sudo apache2ctl -S

Point Certbot at that exact folder (Laravel-style apps serve from /public):

bash
sudo certbot certonly --webroot -w /var/www/example.com/public \
  -d example.com -d www.example.com

A Node.js or Next.js app behind proxy_pass swallows every URL and returns its own 404. Give the challenge path its own Nginx location:

nginx
location ^~ /.well-known/acme-challenge/ {
    root /var/www/letsencrypt;
    default_type "text/plain";
    try_files $uri =404;
}

Insider Insight: The common hardening rule location ~ /\. { deny all; } also blocks /.well-known/ with a 403. The ^~ prefix above beats regex locations, so the challenge path wins without weakening the dotfile rule.

On Apache with an .htaccess front controller (WordPress, most PHP apps), add RewriteRule ^\.well-known/acme-challenge/ - [L] above the index.php rule. The web server user also needs read access: directories 755, files 644 (see Linux file permissions like 755 and 644 and Linux users, groups and permissions).

Cause 2: DNS points at the wrong server (stale A or AAAA)

Compare public DNS with your server's real addresses:

bash
dig +short A example.com
dig +short AAAA example.com
ip -4 addr show scope global
ip -6 addr show scope global

The AAAA record is the sneaky one. Per the Let's Encrypt IPv6 support notes, the CA always tries IPv6 first and falls back to IPv4 only on a network timeout, never on a 404. A working IPv4 site can still fail every time.

Across the 4,000+ site migrations Hostaccent has handled since 2016, the most common leftover is an AAAA record still pointing at the old host. Correct or delete the AAAA record, or make the server answer on IPv6 (listen [::]:80; in Nginx), then wait out the TTL, often 300 seconds to 1 hour. SSH complaining after the move too? See the host key verification failed fix.

Cause 3: Cloudflare's proxy is in the way

With an orange-cloud (proxied) record, the CA talks to Cloudflare's edge, not to you. Cloudflare publishes A and AAAA addresses for proxied hostnames, which is why a 2606:4700: address appears even if you never created an AAAA record.

The usual trap is Always Use HTTPS. It redirects the challenge to HTTPS, so your origin must answer on 443. On a new site with SSL mode Full (strict) and no valid certificate yet, that hop fails, which is why renewals work but a first certificate won't issue. WAF rules, Bot Fight Mode or Under Attack mode can also return a 403.

Pick one fix:

  1. Fastest: set the record to DNS only (grey cloud), wait about 5 minutes, issue, then re-enable the proxy.
  2. Durable: replace Always Use HTTPS with a Redirect Rule that skips paths starting /.well-known/acme-challenge/, plus a WAF skip rule for that path.
  3. Best for proxied sites: use DNS-01, so the proxy never matters.
bash
sudo snap set certbot trust-plugin-with-root=ok
sudo snap install certbot-dns-cloudflare
sudo snap connect certbot:plugin certbot-dns-cloudflare
# /root/.secrets/cloudflare.ini contains: dns_cloudflare_api_token = <token>
sudo chmod 600 /root/.secrets/cloudflare.ini
sudo certbot certonly --dns-cloudflare \
  --dns-cloudflare-credentials /root/.secrets/cloudflare.ini \
  -d example.com -d '*.example.com'

Scope the token to Zone, DNS, Edit on one zone. On our own stack (Cloudflare in front of Nginx and Apache, with API-driven DNS) we issue through DNS-01 for exactly this reason. If you only need the Cloudflare-to-origin hop covered, a Cloudflare Origin CA certificate skips ACME altogether.

Live site down and no time to experiment? Our engineers can fix this exact authorization failure for a small one-time fee, and you'll see the exact quote before anyone touches your server. Hosted with Hostaccent? Then problems like this are simply covered by support, free. Have an engineer fix it

Cause 4: A redirect sends the CA somewhere it can't follow

Redirects must stay on port 80 or 443, stay within 10 hops, and end somewhere that serves the same token. The IPv4 fallback only applies to the first request, so a redirect plus a broken AAAA record fails. Exempt the challenge path:

nginx
server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;

    location ^~ /.well-known/acme-challenge/ {
        root /var/www/letsencrypt;
    }
    location / {
        return 301 https://$host$request_uri;
    }
}

On Apache, add RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ above your HTTPS redirect, and make sure www and the bare domain resolve to the same server.

Cause 5: A firewall or geo-block drops some validation requests

Let's Encrypt checks from several regions and doesn't publish its validation IPs, so country blocking causes intermittent timeouts. Keep port 80 open to everyone (sudo ufw allow 80/tcp, or exclude it from CSF country denies) and geo-block the application instead, or use DNS-01. cPanel's AutoSSL uses the same HTTP check, one more item a proper cPanel server setup should cover.

How to Confirm the Fix Without Burning Your Rate Limit

Test against staging first, then issue for real. As of November 2026, Let's Encrypt production allows only 5 failed authorizations per hostname, per account, per hour, refilling one every 12 minutes (Let's Encrypt rate limits). Running --dry-run against staging, which has far higher limits, means a bad config never costs you that hour.

bash
# Uses staging, issues nothing
sudo certbot certonly --webroot -w /var/www/example.com/public \
  -d example.com -d www.example.com --dry-run

# When the dry run passes, drop --dry-run, then confirm
sudo certbot certificates
curl -vI https://example.com 2>&1 | grep -E "expire date|issuer"

To stop it recurring:

  • Keep a port-80 challenge location that bypasses redirects, apps and deny rules.
  • Fix or delete AAAA records whenever you change servers.
  • Use DNS-01 behind Cloudflare's proxy or a geo-blocking firewall.
  • Re-run the Four-Curl Test after every DNS or proxy change, and finish with sudo certbot renew --dry-run.

Still Not Working? Check These Before Giving Up

If every test passes and issuance still fails, the cause is usually an outdated Certbot or a duplicate site definition. Builds older than 0.22 only speak ACME v1, which Let's Encrypt switched off in 2021, and old 0.x apt packages miss years of fixes, so check certbot --version first.

  • Old version: remove it and install the snap build (sudo snap install --classic certbot), as the Certbot user guide recommends.
  • Duplicate names: two vhosts sharing a server_name or ServerName can send the CA to the one Certbot didn't edit.
  • The log: re-run with -v and read /var/log/letsencrypt/letsencrypt.log for the exact response the CA got.

Do I really have to turn off Cloudflare to get a certificate?

No. The challenge path just has to reach your server over plain HTTP, or you skip HTTP entirely with DNS-01. Pausing the proxy for 5 minutes works in a pinch; a path exemption or DNS-01 fixes it permanently.

Your Next Step: Fixed It, or Still Stuck?

If the Four-Curl Test pointed you at a stray AAAA record or a Cloudflare redirect and you fixed it, keep that probe file handy: one curl after every DNS change prevents the next certbot the client lacks sufficient authorization error. On a properly managed server, though, chasing SSL issuance is support's job, not yours. Hostaccent VPS plans give you full root access plus 24/7 help from our own engineers, and you can start on the Standard VPS plan at Standard VPS, $12.00/mo, renewing at that same price. Skip it if you need a cPanel licence bundled in; that's sold separately.

Still stuck? Open a ticket with our engineers for a small one-time fee, with the exact quote shown before any work starts.

Frequently Asked Questions

Can a Cloudflare proxy cause certbot the client lacks sufficient authorization?

Yes, and it's one of the most common causes on new sites. When a record is proxied, Let's Encrypt connects to Cloudflare's edge, not your server. If Always Use HTTPS is on and your origin can't answer on port 443 yet, or a WAF rule returns a 403, validation fails. Exempt the challenge path from the redirect, pause the proxy for a few minutes, or switch to DNS-01 with an API token.

Why does the ACME challenge return 404 when the file exists?

Because the request is reaching a different place than the folder Certbot wrote to. The usual reasons are a webroot that misses a /public subfolder, a second vhost answering for the same name, an app router catching every URL, or an AAAA record pointing at another server. Run curl against the origin IP with --resolve and against public DNS, then compare the two responses to see which layer is wrong.

Does Let's Encrypt use IPv6 or IPv4 to validate my domain?

If your domain has an AAAA record, Let's Encrypt tries IPv6 first. It falls back to IPv4 only when the IPv6 connection times out, not when IPv6 returns a 404 or wrong content. That means a broken AAAA record can fail validation even though the site loads fine for you over IPv4. Either make the server answer on IPv6 port 80 or remove the AAAA record and wait for its TTL.

How many times can I retry Certbot before I'm rate limited?

Let's Encrypt allows 5 failed authorizations per hostname, per account, per hour in production. The allowance refills at one failure every 12 minutes, so a burst of failed attempts can block you for up to an hour. Use --dry-run, which runs against the staging environment and its much higher limits, until the challenge passes. Only then run the real command, and you'll rarely touch the production limit at all.

Should I switch from HTTP-01 to DNS-01 validation?

Switch if your site sits behind a CDN proxy, a geo-blocking firewall, or a load balancer, or if you need a wildcard certificate. DNS-01 proves control with a TXT record, so port 80 doesn't matter. The trade-off is that your server stores a DNS API token, so scope it to editing one zone's records only. For a single plain server with port 80 open, HTTP-01 is simpler and perfectly fine.

Professional help available

Still seeing the Cloudflare error? We can trace the edge and origin together.

Send the error code, affected hostname, and recent DNS or SSL changes. We will separate edge, origin, firewall, and certificate causes before proposing work.

  • No hosting transfer required
  • Scope confirmed before paid work
  • No changes before your approval
Request Cloudflare helpExplore Cloudflare supportHosted elsewhere? One-time paid support is available after scope and price confirmation.
Reviewed by

Hostaccent Editorial Team

Reviewed for technical accuracy and clarity before publication.

Last updated

Nov 19, 2026

HostAccent Editorial Team publishes practical hosting guides, operations checklists, and SEO-focused tutorials for businesses building international web presence.

Discussion

Have a question or tip about this topic? Share it below — your comment will appear after review.

Your email stays private and is only used for moderation.

Write for the Community

Have a tutorial, tip, or insight to share? Get published on the Hostaccent Blog with your name, bio, and website link.

Become a Contributor

Need a faster setup for this workflow?