<!-- https://pkizerotohero.com/errors/cloudflare-526-invalid-ssl-certificate/ | Markdown mirror of the HTML page | PKI Zero to Hero, by Duyutech BV -->

> Fix Cloudflare 526 under Full (strict): check origin certificate names, expiry, intermediate chains and Origin CA trust without weakening TLS.

Source: https://pkizerotohero.com/errors/cloudflare-526-invalid-ssl-certificate/ · Last reviewed: 2026-10-25

- 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.

[Check yours: Chain checker](https://pkizerotohero.com/tools/chain/)

## Where you see it

When a proxied website uses Cloudflare **Full (strict)** and the origin’s certificate fails validation:

```text
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](https://pkizerotohero.com/errors/cloudflare-525-ssl-handshake-failed/) 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](https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/full-strict/) 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:

```bash
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:

```bash
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](https://pkizerotohero.com/handbook/glossary/#subject-alternative-name), 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](https://pkizerotohero.com/guides/build-fullchain/) and [installing it in NGINX](https://pkizerotohero.com/guides/install-certificate-nginx/).

For a public CA, check the deployed result without changing DNS:

```bash
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](https://developers.cloudflare.com/ssl/origin-configuration/origin-ca/), or an intentionally configured [Custom Origin Trust Store](https://developers.cloudflare.com/ssl/origin-configuration/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:

```bash
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](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-526/) 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.

Warning

Keep Full (strict)

Changing Full (strict) to Full removes the origin identity check. Repair the certificate, chain or deliberate trust configuration instead; an encrypted connection alone does not establish which server answered.

## Check yours

*Interactive tool: Chain checker (runs in the browser at [/tools/chain/](https://pkizerotohero.com/tools/chain/))*

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](https://pkizerotohero.com/handbook/certificate-chains/), [trust stores](https://pkizerotohero.com/handbook/trust-stores/) and [SANs](https://pkizerotohero.com/handbook/names-and-key-usage/).
- [Cloudflare 525: SSL handshake failed](https://pkizerotohero.com/errors/cloudflare-525-ssl-handshake-failed/) for failures before certificate validation completes.
- [Cloudflare’s 526 reference](https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/error-526/), [strict mode](https://developers.cloudflare.com/ssl/origin-configuration/ssl-modes/full-strict/) and [Origin CA](https://developers.cloudflare.com/ssl/origin-configuration/origin-ca/).

**Early edition.** Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? [Tell us](https://pkizerotohero.com/contact/?topic=content-error&page=/errors/cloudflare-526-invalid-ssl-certificate/).

Last reviewed 25 October 2026Edition 0.9

## Learn why it happens

- [Chapter 13: Certificate chains and path validation](https://pkizerotohero.com/handbook/certificate-chains/)
- [Chapter 12: Who do we trust? CAs, trust stores and self-signed certificates](https://pkizerotohero.com/handbook/trust-stores/)
- [Chapter 9: Names and jobs: SANs, wildcards, key usage and the CA flag](https://pkizerotohero.com/handbook/names-and-key-usage/)

## Everything on this topic

- [Chains and trust stores](https://pkizerotohero.com/topics/chains-and-trust/)
- [TLS and HTTPS](https://pkizerotohero.com/topics/tls/)
