HTTP-01 validation can work fine through the Cloudflare proxy — the CA fetches /.well-known/acme-challenge/<token> over port 80, Cloudflare forwards it, the origin answers. It breaks when something at the edge answers instead of the origin: a managed challenge page, Bot Fight Mode, a WAF rule, or a redirect that rewrites the path. The fix is either to exempt the ACME path from edge interference, or to stop depending on HTTP reachability entirely by switching to DNS-01 through the Cloudflare API. cPanel AutoSSL’s HTTP DCV fails for exactly the same reasons.
What’s happening
With a proxied (orange-cloud) record, the CA’s validation servers resolve your hostname to Cloudflare’s edge. Normally the edge proxies the request through and validation passes — Let’s Encrypt even follows redirects to HTTPS, so Always Use HTTPS alone rarely breaks it. The failures come from features that terminate the request at the edge: Under Attack Mode and managed challenges serve an interstitial the ACME validator cannot execute; Bot Fight Mode on the Free plan challenges automated traffic and — a real limitation — cannot be exempted by WAF skip rules; custom or managed WAF rules can block the path; Redirect Rules or legacy Page Rules can send the token request somewhere the token is not. On the origin side, the classic non-Cloudflare failure still applies: the challenge file lands in one docroot while the vhost serves another, and a forgotten AAAA record pointing at the wrong host fails validators that prefer IPv6 while all your IPv4 tests pass.
What to check first
- The exact error text from certbot or the AutoSSL log: timeout, 403, connection reset, or “unexpected content” all point at different layers.
- Whether the hostname is proxied, and whether Under Attack Mode or Bot Fight Mode is currently on.
- Recent edge changes: new WAF rules, redirect rules, or security-level changes that coincide with the first failed renewal.
- Where the ACME webroot actually is for this vhost, and whether an AAAA record exists.
How to verify
# Drop a test token at the origin webroot
mkdir -p /var/www/html/.well-known/acme-challenge
echo probe > /var/www/html/.well-known/acme-challenge/probe
# Fetch through the edge — this is the path the CA takes
curl -si http://example.com/.well-known/acme-challenge/probe | head -8
# Fetch straight from the origin, bypassing Cloudflare
curl -si --resolve example.com:80:<origin-ip> http://example.com/.well-known/acme-challenge/probe | head -8
Read the pair: origin direct works but the edge fetch returns a challenge page, a 403 with cf-mitigated in the headers, or a redirect elsewhere — edge interference, keep reading. Both fail — the problem is your webroot or vhost, and Cloudflare is innocent. Both work — the CA is probably failing over IPv6, so check the AAAA record next.
The fix
- Exempt the ACME path in the WAF. Under Security → WAF → Custom rules, add a rule matching URI Path starts with
/.well-known/acme-challenge/with the action Skip, covering the other custom rules and managed protections the rule form offers. Custom rules exist on every plan, with per-plan quotas. - Stand down interception features during issuance. Turn Under Attack Mode off (or scope a lower security level to the ACME path with a Configuration Rule). If Bot Fight Mode is the blocker on Free, toggle it off for the renewal window — skip rules do not override it. On Pro and Business, check that Super Bot Fight Mode’s verified-bot handling is set to allow, since ACME validators are verified bots.
- Audit redirects on the path. Nothing — Redirect Rules, Page Rules, or origin rewrites — should touch
/.well-known/. Redirects to HTTPS on the same hostname are fine; redirects to another hostname break validation unless the token is reachable there too. - Fix the IPv6 story. If an AAAA record exists, the origin must serve the same content on that address; if it cannot, remove the record rather than leaving a trap for validators.
- Or stop fighting HTTP entirely: switch to DNS-01. With the Cloudflare DNS plugin and a scoped API token (Zone → DNS → Edit), validation happens in DNS and the proxy becomes irrelevant — and DNS-01 is the only challenge type that can issue wildcards anyway:
sudo certbot certonly --dns-cloudflare \
--dns-cloudflare-credentials /root/.secrets/cloudflare.ini \
-d example.com -d '*.example.com'
For cPanel servers, the equivalent move is DNS-based DCV — the setup is in wildcard AutoSSL with Cloudflare DNS, and the HTTP-path hygiene rules are in AutoSSL HTTP-01 reachability.
6. Re-run and confirm. certbot renew --dry-run for Let’s Encrypt, or trigger an AutoSSL check in the panel. Then note the fix in the runbook, because the next edge-rule change can reintroduce it. The ACME background is documented at developers.cloudflare.com/ssl/.
When this fix is wrong
If the failure is NXDOMAIN or SERVFAIL, it is a DNS problem, not proxy interference — no WAF exemption will help. If the certificate is only needed for the edge-to-origin hop of a proxied hostname, the simplest fix is no ACME at all: a Cloudflare Origin CA certificate has no validation dependency and lasts years. And if you have already failed validation five times in the last hour, Let’s Encrypt’s rate limit is now your blocker — stop retrying and use the pause to fix the actual cause.
Common mistakes
- Retry-hammering certbot into rate limits, converting a ten-minute fix into an hours-long wait.
- Leaving Under Attack Mode on “just for now” and forgetting it until renewals start failing 60 days later.
- Testing the challenge path over HTTPS and declaring it reachable — HTTP-01 starts on port 80, so test what the CA tests.
- Assuming a passing IPv4 curl proves reachability while the AAAA record points somewhere else.
- Grey-clouding the record to “fix” issuance and leaving it grey, dropping the WAF and CDN permanently for a problem a skip rule solves.
Prevention
Make the WAF skip rule for /.well-known/acme-challenge/ a standing part of every zone build, not an incident response. Schedule certbot renew --dry-run monthly and alert on failure — it catches broken validation with 60 days of slack instead of zero. Prefer DNS-01 for anything wildcard or anything fragile, and keep origin-certificate expiry monitored directly against the origin so a silent renewal failure still gets caught weeks before impact.
Getting end-to-end TLS right — edge, origin certificate, and the redirect chain — is standard work inside Managed Cloud Ops; book an infrastructure review if you want it verified end to end.