Fix Cloudflare Error 526
Cloudflare error 526: what it means
In Full (Strict) mode Cloudflare connects to your origin over HTTPS and checks the certificate the same way a browser would. If that check fails, visitors see "Error 526: Invalid SSL certificate". The problem is on the origin, not at Cloudflare's edge, so changing browsers or clearing your cache will not help.
Cloudflare error 526: the usual causes
| Cause | How to spot it | Fix |
|---|---|---|
| Expired certificate | "notAfter" date is in the past | Renew and reload the web server |
| Self-signed certificate | Issuer equals subject | Replace with a CA-issued or Origin CA certificate |
| Hostname mismatch | Your domain is missing from the certificate names | Reissue with the correct domain and subdomains |
| Missing intermediate | Chain shows only one certificate | Serve the full chain file, not just the leaf |
| Wrong vhost answers | Another site's certificate is returned | Check server_name or ServerName and SNI |
Test the origin directly
Ask the origin for its certificate, bypassing Cloudflare. Replace the IP and domain with your own:
openssl s_client -connect ORIGIN_IP:443 -servername example.com -showcerts < /dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
Check that the dates are valid, the names include your domain, and the issuer is a real CA (or Cloudflare Origin CA). Then run openssl s_client ... -verify_return_error if you want OpenSSL to fail loudly on chain problems. You can also check the public side of your site with the SSL checker, though remember that it sees Cloudflare's certificate, not your origin's.
Fix it
- Get a valid certificate. Either issue a free Let's Encrypt certificate on the server, or create a Cloudflare Origin CA certificate in the dashboard under SSL/TLS, then Origin Server. Origin CA certificates are trusted by Cloudflare only, which is fine as long as the domain stays proxied.
- Install the full chain. In Nginx use the fullchain file for
ssl_certificate:
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}
- Reload the server (
nginx -t && systemctl reload nginx) and re-run the OpenSSL test. - Check that the key matches. If you installed a new certificate by hand, confirm the pair with the key matcher.
Do not "fix" it by dropping to Flexible
Switching to Flexible mode hides the error, but traffic between Cloudflare and your server then travels unencrypted, and it often creates redirect loops if your origin forces HTTPS. If you need a stopgap while you sort out the certificate, Full (non-strict) accepts an untrusted certificate. Treat that as temporary and return to Full (Strict) once the origin is fixed.
When it is not the certificate
- Port 443 blocked: a firewall that drops Cloudflare's IP ranges usually gives a 521 or 522, not a 526.
- Handshake failure: if the origin cannot agree on a protocol or cipher with Cloudflare you may see error 525 instead. The TLS checker helps confirm which TLS versions your origin offers.
- Recent DNS change: confirm the record points to the right server with the DNS lookup tool.
Related reading: Cloudflare SSL errors, Cloudflare Origin certificates and certificate not trusted.
Frequently Asked Questions
What is the difference between error 525 and 526?
525 means the TLS handshake between Cloudflare and the origin failed. 526 means the handshake worked but the certificate did not pass validation in Full (Strict) mode.
Does a self-signed certificate work with Full (Strict)?
No. Full (Strict) needs a certificate from a trusted CA or a Cloudflare Origin CA certificate.
Will a Cloudflare Origin CA certificate work in a browser?
Not if a visitor reaches your origin directly. It is only trusted by Cloudflare, so keep the site proxied.
How long until the error clears after I fix it?
Usually right away once the origin serves the correct certificate. If it persists, purge the Cloudflare cache and retest the origin with OpenSSL.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.