Cloudflare error 525 or 526 on your website
On this page
With Cloudflare's proxy on (orange cloud), visitors connect to Cloudflare, and Cloudflare connects to this server over HTTPS. Error 526 means the certificate on this server was not accepted; 525 means Cloudflare could not complete the secure connection to this server at all.
Symptoms
- A Cloudflare page: Error 526 — Invalid SSL certificate or Error 525 — SSL handshake failed.
- Sometimes Error 521 (web server is down) or 522 (connection timed out) instead.
- The site worked before you turned on the proxy or changed Cloudflare's SSL mode.
Causes
Most likely first:
- The website has no certificate on this server yet, and Cloudflare's SSL mode is Full (strict), which accepts only a valid certificate. (526)
- The certificate does not cover the name — for example
wwwor a subdomain that is proxied. (526) - The DNS record at Cloudflare points to the wrong address — an old server, or an AAAA record to another server. (525, 521, 522)
- The server does not answer on port 443 — a firewall rule or the web server down. (525, 521, 522)
Fix
Look at both sides
- Open Site Check (section Advanced), choose the website and click Check.
- Address in DNS shows "(Cloudflare proxy: visitors reach Cloudflare, which must forward to …)" with this server's address.
- Certificate shows whether the website has its certificate here and when it expires.
- Answer on this server shows whether the site works on this server directly.
- Open SSL/TLS (section Domains) for the status of each name.
1. No certificate here yet
The panel can issue a certificate while the proxy is on: it checks that a test file in the website's folder comes back through Cloudflare, exactly as the certificate authority will.
- In Cloudflare, set SSL to Full (not strict) for now, so the site works during the check.
- On the SSL/TLS page, click Check now next to the domain. Wait until it shows Secured.
- Switch Cloudflare back to Full (strict). From the panel: Cloudflare (section Domains) → Manage → SSL: Full (strict).
If it still fails, set the record to DNS only (grey cloud) for a few minutes, click Check now, and turn the proxy on again once the domain is Secured.
2. A name is not covered
Each proxied name (www, shop…) must be a website here with its own certificate (or covered by a wildcard). Add the subdomain in Domains, then click Check now on SSL/TLS for it.
3. Wrong address at Cloudflare
Compare the A record at Cloudflare with this server's address (shown in Site Check). The easiest way to get the records right: Cloudflare page → Manage → Copy DNS records from this server. Remove AAAA records that point to another server.
Keep mail, FTP and webmail names on DNS only: they cannot go through the proxy.
4. Port 443 not answering
If Answer on this server also fails, the problem is on this server: contact your host. Administrators check Service Manager (web server running) and Firewall (443 in Open TCP ports). Never block Cloudflare's address ranges in the firewall.
Good to know
- Visitor addresses in logs, Visitors, the IP Blocker and the Protection Shield are the real visitors, not Cloudflare's, for connections that come from Cloudflare.
- Renewals work the same way while the proxy stays on.
- Avoid Cloudflare's Flexible mode: this server sends visitors from
http://tohttps://, which with Flexible causes a redirect loop.
Still not working?
Use Development mode (3 hours, no cache) on the Cloudflare page to rule out Cloudflare's cache, and contact your host through Support with the Site Check result.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- SSL certificate not valid (NET::ERR_CERT_COMMON_NAME_INVALID)
Fix "Your connection is not private" and NET::ERR_CERT_COMMON_NAME_INVALID: see why the free certificate was not issued for your site and request it.
- Too many redirects (ERR_TOO_MANY_REDIRECTS) on your website
Fix ERR_TOO_MANY_REDIRECTS ("redirected you too many times"): Cloudflare Flexible SSL, http/https or www rules, redirects and WordPress addresses.
- Website not working after changing nameservers (DNS)
You changed nameservers or DNS records and the site still shows the old server or nothing. Check where the domain points, how long DNS takes and what to fix.