Skip to content

AutoSSL DCV failures on domains proxied through Cloudflare

AutoSSL keeps failing domain control validation once the orange cloud is on. How HTTP validation interacts with the Cloudflare edge, why the DNS fallback goes nowhere, and the fixes that hold.

AutoSSL’s HTTP validation usually survives the Cloudflare proxy — the certificate authority fetches the token through the edge and reaches your origin like any other visitor. When it fails on a proxied domain, something at the edge is eating the validation request: a WAF challenge, Bot Fight Mode, Under Attack mode, a redirect rule, or an origin Cloudflare cannot reach at all. And cPanel’s DNS-based fallback cannot rescue you, because it writes TXT records into the local zone that stopped being authoritative the day DNS moved to Cloudflare. The fix is to make /.well-known/acme-challenge/ untouchable at the edge, not to fight AutoSSL.

What’s happening

Current cPanel versions use Let’s Encrypt as the AutoSSL provider. For each domain, cPanel runs a local pre-flight — it publishes a token under /.well-known/ and fetches it over HTTP the way the CA would — then Let’s Encrypt performs the real HTTP-01 validation from the outside. With the orange cloud on, both of those requests pass through Cloudflare. Plain proxying is transparent to them, and redirects to HTTPS are fine (HTTP-01 follows them), so a stock configuration validates without drama.

The failures come from edge features that refuse or transform the request. A managed challenge cannot be solved by an ACME client, so the CA gets an interstitial instead of the token — the response even carries a cf-mitigated: challenge header. Bot Fight Mode on the Free plan is a blunt instrument with no path exclusions and has a history of blocking validation traffic. Redirect or transform rules that touch the path break the token URL. And if Cloudflare cannot reach the origin at all, DCV fails along with everything else — that is a 522 problem, not a certificate problem.

When HTTP fails, cPanel’s provider attempts DNS-based validation by publishing _acme-challenge TXT records — into the zone on the cPanel server. If Cloudflare is authoritative, nobody ever queries that zone, so the fallback fails silently every time. This is the piece that turns a one-off hiccup into “AutoSSL has been failing for weeks.”

What to check first

Read the actual AutoSSL log before changing anything — it names the DCV method and the exact error. Then establish whether the edge or the origin refused the request, which one curl --resolve comparison settles in seconds.

How to verify

# Run a check for one account and read the newest log
whmapi1 start_autossl_check_for_one_user username=exampleuser
ls -t /var/cpanel/logs/autossl/ | head -3

# Plant a probe token and fetch it through the edge, then direct
echo probe > /home/exampleuser/public_html/.well-known/acme-challenge/probe.txt
curl -si http://example.com/.well-known/acme-challenge/probe.txt | head -12
curl -si --resolve example.com:80:203.0.113.10 \
  http://example.com/.well-known/acme-challenge/probe.txt | head -12

If the direct fetch returns the token while the proxied fetch returns a 403, a challenge page, or a cf-mitigated header, the edge is the blocker. Remove the probe file afterwards. The log lives under /var/cpanel/logs/autossl/ per run; WHM » SSL/TLS » AutoSSL » Logs shows the same content with less typing.

The fix

  1. Create a WAF skip for the ACME path. In Security » WAF » Custom rules, add a rule matching URI Path starts with /.well-known/acme-challenge/ with the Skip action covering the rules that were firing. This is the durable fix and works on every plan.
  2. Rein in Bot Fight Mode. The Free-plan toggle has no exceptions — if the AutoSSL log shows blocks and your skip rule cannot help, turn Bot Fight Mode off. Paid bot tooling (Super Bot Fight Mode and up) can be configured around verified bots instead.
  3. Audit redirect and transform rules. Anything that rewrites or forwards requests under /.well-known/ breaks token retrieval. Scope those rules to exclude the ACME path.
  4. Confirm the origin is reachable through the proxy. A site throwing 522/523 fails DCV incidentally. Fix reachability first.
  5. As a temporary bypass, grey-cloud, validate, re-orange. Setting the record to DNS only, running the AutoSSL check, and re-enabling the proxy works — but it is manual, it exposes the origin IP in DNS while grey, and next quarter’s renewal hits the same wall. Treat it as a diagnostic, not a fix.
  6. For wildcards or fully locked-down edges, validate in DNS at Cloudflare, outside AutoSSL. AutoSSL cannot publish _acme-challenge records at Cloudflare, so it cannot issue wildcards while Cloudflare hosts your DNS. Use a Cloudflare Origin CA certificate or an ACME client that writes the TXT record through the Cloudflare API. Both routes are in wildcard certificates on cPanel when DNS is on Cloudflare.
  7. For hostnames that only ever exist behind the proxy, a Cloudflare Origin CA certificate installed in cPanel is a legitimate alternative: 15-year lifetime, trusted by Cloudflare’s edge (which is all that connects to the origin), and no DCV cycle at all. Visitors still see the edge certificate. Just remember it is worthless for direct, un-proxied access.

When this fix is wrong

If the AutoSSL log shows DCV failing because the domain does not point at this server at all — parked elsewhere, still on old DNS, a typo subdomain — no edge rule will help; fix where the domain resolves first. If the error is a Let’s Encrypt rate limit, the volume of failed attempts is the problem, and the cure is stopping the retry loop, not adding rules. And a broken vhost that 404s everything under /.well-known/ is an Apache problem that would fail with or without Cloudflare.

Common mistakes

Setting the Cloudflare TLS mode to Flexible to “make SSL work” — that creates redirect loops and ships plaintext to the origin. Disabling the entire WAF instead of skipping one path. Leaving probe files in public_html. Grey-clouding as a permanent workflow and re-discovering the failure at every renewal. Excluding the domain from AutoSSL so the warning emails stop — the certificate still expires.

Prevention

Make the ACME skip rule part of the standard zone template you apply to every cPanel-fronting Cloudflare zone, and leave AutoSSL’s notification emails on (WHM » Contact Manager) so a regression surfaces as an email instead of an expiry page. Cloudflare’s own overview of how its features interact with well-known paths is in the fundamentals documentation.

Running Cloudflare in front of cPanel/WHM is a stack Stack Harbor operates daily as an official cPanel NOC partner — cPanel server management covers the DNS, mail, SSL, and firewall plumbing, and you can start a conversation any time.