Skip to main content
HTTP/5xx (Server Error)

526 Invalid SSL Certificate

Cloudflare-specific: Cloudflare could not validate the origin's SSL certificate in Full (strict) mode.

❓ Why does this happen?

Expired, self-signed, or hostname-mismatched certificate on the origin server.

✅ How to fix it

Renew the certificate (certbot renew) or install a Cloudflare Origin CA certificate for the hostname.

Return or handle 526 in your stack

// Note: 526 is normally generated by Cloudflare, not your app.
// Emitting it yourself is only useful for testing client error handling.
// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Invalid SSL Certificate", status: 526 },
    {
      status: 526
    }
  );
}

Live 526 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 526 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/526

Frequently Asked Questions

What does HTTP Status 526 mean?
Cloudflare-specific: Cloudflare could not validate the origin's SSL certificate in Full (strict) mode.
Why am I getting a 526 status code?
Expired, self-signed, or hostname-mismatched certificate on the origin server.
How do I fix a 526 Invalid SSL Certificate error?
Renew the certificate (certbot renew) or install a Cloudflare Origin CA certificate for the hostname.
How can I test how my app handles a 526 response?
Send a request to https://castov.com/api/mock/526 — it returns a real 526 Invalid SSL Certificate response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 5xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.