- Cloudflare
Cloudflare Error 526: invalid SSL certificate
Also seen in: Cloudflare Full (strict), Cloudflare Workers, Cloudflare Gateway
In one sentence
Cloudflare rejected the certificate presented by your origin; check its name, validity, chain and trusted issuer while keeping Full (strict) enabled.
Where you see it
When a proxied website uses Cloudflare Full (strict) and the origin’s certificate fails validation:
Error 526: invalid SSL certificate
This page addresses the website-to-origin connection. Cloudflare Workers and Gateway can also return 526 under their own validation rules; those cases are distinguished below. The related 525 error means the origin handshake failed, so start with the TLS listener and negotiation instead.
What it means
Cloudflare did not accept the origin server’s identity. The browser sees Cloudflare’s edge certificate, but Cloudflare checks a different certificate at your origin. A valid edge certificate therefore does not prove that the origin’s certificate is valid. Cloudflare’s strict-mode documentation requires an unexpired certificate, a matching hostname and an issuer it trusts, including Cloudflare Origin CA.
Likely causes
The origin serves an expired certificate or the wrong hostname
Get the origin address from your configuration; public DNS normally points at Cloudflare. Replace the reserved address below and keep the site’s real hostname:
openssl s_client -connect 203.0.113.10:443 \
-servername www.example.com -showcerts </dev/null
Save the first public PEM certificate as origin-leaf.pem, then inspect it:
openssl x509 -in origin-leaf.pem -noout \
-subject -issuer -dates -ext subjectAltName
openssl x509 -in origin-leaf.pem -noout -checkhost www.example.com
Check the Subject Alternative Names, the clock and the validity interval. A certificate for the apex does not automatically cover www, and a wildcard covers only one additional label. Issue a replacement with the correct SANs, install it on the active TLS listener and reload the service. If an origin rule changes the hostname used for origin validation, check that configured name as well.
The leaf is correct but an intermediate is missing
The -showcerts output is the chain the origin sends, not a guarantee of trust. A publicly trusted origin normally sends the leaf followed by the required intermediates. Configure the full chain as described in building a fullchain file and installing it in NGINX.
For a public CA, check the deployed result without changing DNS:
curl --resolve www.example.com:443:203.0.113.10 \
--connect-timeout 10 --head https://www.example.com/
curl retains the hostname for SNI and verification while connecting to your chosen address. A successful TLS connection with an HTTP response is useful evidence; it does not reproduce every Cloudflare policy check, including revocation or an explicitly configured origin trust store.
A self-signed or private certificate is outside Cloudflare’s trust
Installing an organisation’s root on your laptop does not install it at Cloudflare. Use a publicly trusted certificate, Cloudflare Origin CA, or an intentionally configured Custom Origin Trust Store where appropriate for your account and service.
Origin CA has a deliberate boundary: Cloudflare trusts it for the origin connection; ordinary browsers normally do not. Pausing proxying or switching the DNS record to DNS-only can consequently expose a browser trust error even though Full (strict) worked. If the origin must support direct browser traffic, choose a publicly trusted certificate.
To test an Origin CA certificate directly, obtain its matching root from Cloudflare’s official Origin CA page and use it explicitly:
curl --cacert /path/to/origin-ca-root.pem \
--resolve www.example.com:443:203.0.113.10 \
--head https://www.example.com/
Do not copy a random certificate from the failed connection into a trusted root file. Verify which CA issued it and use that CA’s documented trust material.
Only one origin or deployment still has the bad certificate
Test every configured address and backend, including IPv6, using the same hostname. Compare serial numbers and dates. A successful renewal on disk does not mean each server reloaded it. Fix the deployment or reload hook, then check the certificate actually served over the network.
The 526 comes from Workers or Gateway
Cloudflare’s 526 reference says Workers subrequests to external, unproxied hostnames use strict validation regardless of the Worker’s zone encryption setting. Gateway also has its own trust, revocation and cipher checks. Diagnose the failing outbound hostname and the relevant service’s policy, rather than changing your website’s edge certificate.
Check yours
Paste the origin’s public PEM chain, then repeat the original proxied request with Full (strict) enabled. Check that the error disappears without a DNS bypass or verification exception.
Learn why
- Certificate chains, trust stores and SANs.
- Cloudflare 525: SSL handshake failed for failures before certificate validation completes.
- Cloudflare’s 526 reference, strict mode and Origin CA.
Does your team keep hitting this?
Everyone can use the lessons. Team seats add earned credentials, invitations and a completion report, so you see who has finished.
Early edition. Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? Tell us.