Fix Cloudflare SSL Error 526: Invalid SSL Certificate
Cloudflare Error 526 means Cloudflare cannot validate the SSL certificate on your origin server. This happens when Cloudflare connects to your server in Full (strict) or Full SSL mode and the certificate on your origin is invalid, expired, or self-signed without being trusted.
Understanding Cloudflare SSL Modes
No SSL. HTTP everywhere. Never use this.
Cloudflare↔User: HTTPS. Cloudflare↔Origin: HTTP. No cert needed on origin.
Cloudflare↔Origin: HTTPS but does NOT validate cert. Self-signed OK.
Cloudflare↔Origin: HTTPS AND validates cert. Requires trusted or Cloudflare Origin CA cert.
Why Error 526 Occurs
Fix Option 1 — Use Cloudflare Origin CA Certificate (Recommended)
Cloudflare offers free Origin CA certificates trusted by Cloudflare's edge servers. This is the best approach for Full (Strict) mode:
- Go to Cloudflare Dashboard → SSL/TLS → Origin Server
- Click "Create Certificate" and choose RSA or ECC
- Copy the certificate and private key to your origin server
- Install them in your web server (Nginx/Apache)
- Also download the Cloudflare Origin CA root certificate and add it to your chain
Fix Option 2 — Install a Valid Public Certificate
If you want a certificate that also works without Cloudflare, use Let's Encrypt or another public CA:
# Install Certbot and get a Let's Encrypt certificate sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Fix Option 3 — Downgrade to Full (Not Strict)
If you need a quick fix and have a self-signed certificate on origin, switch to Full mode (not strict) in the Cloudflare dashboard. This still encrypts traffic but does not validate the origin certificate. Upgrade to Full (Strict) once you have a valid cert.
Verify the Fix
Use our free SSL Certificate Checker to inspect your origin certificate directly — verifying validity, expiry, and whether the hostname matches your certificate's SANs.