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

525 SSL Handshake Failed

Cloudflare-specific: the SSL/TLS handshake between Cloudflare and the origin failed.

❓ Why does this happen?

Origin has no valid certificate on port 443, or cipher/SNI mismatch in Full / Full (strict) SSL mode.

✅ How to fix it

Install a valid certificate (or a Cloudflare Origin CA certificate) on the origin and ensure port 443 serves TLS.

Return or handle 525 in your stack

// Note: 525 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: "SSL Handshake Failed", status: 525 },
    {
      status: 525
    }
  );
}

Live 525 mock endpoint

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

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

Frequently Asked Questions

What does HTTP Status 525 mean?
Cloudflare-specific: the SSL/TLS handshake between Cloudflare and the origin failed.
Why am I getting a 525 status code?
Origin has no valid certificate on port 443, or cipher/SNI mismatch in Full / Full (strict) SSL mode.
How do I fix a 525 SSL Handshake Failed error?
Install a valid certificate (or a Cloudflare Origin CA certificate) on the origin and ensure port 443 serves TLS.
How can I test how my app handles a 525 response?
Send a request to https://castov.com/api/mock/525 — it returns a real 525 SSL Handshake Failed 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.