
A Cloudflare Error 526 means Cloudflare successfully connected to your origin server and completed the SSL handshake, but couldn't validate the SSL certificate your origin presented. The certificate exists and the handshake worked technically, but something about the certificate itself is wrong.
This error only occurs when your Cloudflare SSL mode is set to Full (Strict), which requires a valid, trusted certificate on your origin. Understanding the difference between SSL modes is key to fixing this.
Cloudflare's SSL modes determine how strictly it validates your origin's certificate:
A 526 only appears in Full (Strict) mode. It means Cloudflare validated the certificate and found a problem. The handshake itself succeeded (unlike a 525 error), but the certificate failed trust validation.
You generated a self-signed certificate for your origin server. Cloudflare in Full (Strict) mode doesn't trust self-signed certificates because no certificate authority (CA) vouches for them.
# Check if the certificate is self-signed
echo | openssl s_client -connect YOUR_ORIGIN_IP:443 -servername yourdomain.com 2>/dev/null | openssl x509 -noout -issuer -subject
# Self-signed example:
# issuer=CN = yourdomain.com
# subject=CN = yourdomain.com
# (issuer and subject are the same)
The certificate was valid but has expired. Cloudflare can't trust an expired certificate in Strict mode.
# Check expiry dates
echo | openssl s_client -connect YOUR_ORIGIN_IP:443 -servername yourdomain.com 2>/dev/null | openssl x509 -noout -dates
# notBefore=Jan 15 00:00:00 2025 GMT
# notAfter=Jan 15 00:00:00 2026 GMT <-- expired
The certificate is valid and trusted, but it was issued for a different domain. If your site is example.com but the certificate is for otherdomain.com, Cloudflare rejects it.
# Check which domains the certificate covers
echo | openssl s_client -connect YOUR_ORIGIN_IP:443 -servername yourdomain.com 2>/dev/null | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"
Your origin server has a valid certificate but isn't sending the complete certificate chain. The intermediate certificates that link your certificate to a trusted root CA are missing, so Cloudflare can't verify the trust chain.
# Check the certificate chain
echo | openssl s_client -connect YOUR_ORIGIN_IP:443 -servername yourdomain.com 2>/dev/null | grep -E "^(Certificate chain| [0-9]+ s:)"
# A complete chain should show multiple certificates:
# 0 s:CN = yourdomain.com
# 1 s:CN = Let's Encrypt Authority X3
# 2 s:CN = DST Root CA X3
If you only see certificate 0, the intermediates are missing.
The wrong certificate file was installed on the server. This can happen after a renewal when the old certificate file gets referenced instead of the new one, or when certificates for different domains get mixed up.
Your certificate was issued by a CA that Cloudflare doesn't recognise. This is rare with standard CAs (Let's Encrypt, DigiCert, Comodo, etc.) but can happen with private or internal CAs.
Cloudflare Origin Certificates are specifically designed for this purpose. They're free, last up to 15 years, and are always trusted by Cloudflare in Full (Strict) mode.
example.com and *.example.com).Install them on your server:
Nginx:
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/ssl/cloudflare/origin.pem;
ssl_certificate_key /etc/ssl/cloudflare/origin-key.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
}
Apache:
<VirtualHost *:443>
ServerName yourdomain.com
SSLEngine on
SSLCertificateFile /etc/ssl/cloudflare/origin.pem
SSLCertificateKeyFile /etc/ssl/cloudflare/origin-key.pem
</VirtualHost>
# Restart the web server
sudo nginx -t && sudo systemctl reload nginx
# or
sudo apachectl configtest && sudo systemctl reload apache2
A free, auto-renewing certificate from a trusted CA:
# Install certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
# Generate and install certificate
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Verify auto-renewal is working
sudo certbot renew --dry-run
If you have a valid certificate but the intermediates are missing, concatenate them:
# Create a full chain file
cat your-domain-cert.pem intermediate-cert.pem > fullchain.pem
Update your server config to use the full chain:
# Nginx
ssl_certificate /etc/ssl/fullchain.pem;
ssl_certificate_key /etc/ssl/private-key.pem;
# Apache
SSLCertificateFile /etc/ssl/fullchain.pem
SSLCertificateKeyFile /etc/ssl/private-key.pem
If you need a quick fix, you can change the SSL mode from Full (Strict) to Full in the Cloudflare dashboard under SSL/TLS > Overview. This makes Cloudflare accept any certificate, including self-signed and expired ones.
Important: This reduces security. In Full mode, a man-in-the-middle attack between Cloudflare and your origin could go undetected. Use this only as a temporary measure while you fix the certificate.
After installing or fixing the certificate:
# Test the certificate directly
echo | openssl s_client -connect YOUR_ORIGIN_IP:443 -servername yourdomain.com 2>/dev/null | openssl x509 -noout -subject -issuer -dates
# Test through Cloudflare
curl -I https://yourdomain.com
# Verify the full chain
echo | openssl s_client -connect YOUR_ORIGIN_IP:443 -servername yourdomain.com 2>&1 | grep "Verify return code"
# Should show: Verify return code: 0 (ok)
A 526 error makes your site completely inaccessible. SSL certificate problems are especially dangerous because they can happen suddenly — a certificate expires overnight, an auto-renewal fails silently, or a server rebuild forgets to include the intermediate chain. You need to know about these failures the moment they happen, not when you check your traffic stats days later and see a cliff.
Domain Monitor checks your site every minute from multiple locations, detecting 526 errors and other Cloudflare SSL issues immediately. You'll receive an alert via email, SMS, or Slack within seconds. Domain Monitor also monitors your SSL certificates directly, warning you before they expire so you can renew proactively. Set up downtime alerts for your domains and use comprehensive website monitoring to ensure your SSL configuration stays healthy.
| Cause | Fix |
|---|---|
| Self-signed certificate | Install Cloudflare Origin Certificate or Let's Encrypt |
| Expired certificate | Renew the certificate, set up auto-renewal |
| Domain name mismatch | Install a certificate for the correct domain |
| Missing intermediate chain | Concatenate intermediates into fullchain.pem |
| Untrusted CA | Use a publicly trusted CA |
| Wrong SSL mode | Use Full (Strict) with a valid certificate |
A 526 means "your certificate exists but isn't valid." The fix is almost always straightforward: install a proper, trusted certificate on your origin and ensure the full chain is served. Cloudflare Origin Certificates are the easiest and most reliable option for sites behind Cloudflare.
Wildcard, SAN (multi-domain), and single-domain SSL certificates cover different use cases. Here's a clear comparison to help you pick the right type — and avoid paying for coverage you don't need.
Read moreDNS resolves correctly from your office but fails for users in other countries or on different ISPs. Here's why geographic DNS inconsistency happens and how to diagnose which layer is causing it.
Read moreRegistrar lock and transfer lock are often confused — and disabling the wrong one leaves your domain vulnerable. Here's a clear breakdown of what each does and when to use them.
Read moreLooking to monitor your website and domains? Join our platform and start today.