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/526Frequently Asked Questions
What does HTTP Status 526 mean?
Why am I getting a 526 status code?
How do I fix a 526 Invalid SSL Certificate error?
How can I test how my app handles a 526 response?
Other 5xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.