Troubleshooting guide · cloudflare · Published 2026-08-15 · 4 min read

Cloudflare 525 SSL handshake failed

Diagnose and fix Cloudflare 525 SSL handshake failed errors. Check SSL mode, origin TLS, certificate hostname and expiry, plus openssl connection tests.

What 525 means

Cloudflare 525 "SSL handshake failed" appears when the edge opened a TCP connection to your origin server and then the TLS handshake on top of that connection failed before it completed. The origin is reachable at the network level, but the cryptographic negotiation did not finish. This differs from 526, where the handshake succeeds and the certificate is then rejected as invalid.

Because the handshake happens between Cloudflare and the origin, the visitor only ever sees the Cloudflare 525 error page. Diagnostics have to be run at the origin, not in the browser.

What breaks the handshake

Ordered fixes

  1. Check the SSL mode in the dashboard under SSL/TLS. The table below shows what each mode expects from the origin. Flexible speaks HTTP to the origin, Full and Full (strict) speak HTTPS. A mode that asks for HTTPS from an HTTP-only origin produces 525 or a redirect loop.

| SSL mode | Visitor to Cloudflare | Cloudflare to origin | Origin cert check |

| Flexible | HTTPS | HTTP | none |

| Full | HTTPS | HTTPS | TLS only |

| Full (strict) | HTTPS | HTTPS | Must be valid for the hostname |

  1. Test the origin directly, bypassing Cloudflare. From a machine that reaches the origin network, run the open SSL connection test:
openssl s_client -connect 203.0.113.25:443 -servername origin.example.com

If this fails, the origin itself is broken and changing Cloudflare settings will not help. If the connection succeeds here, the recorded origin address in the dashboard does not match reality, or the certificate only works when the handshake is asked for a different name.

  1. Validate the certificate details:

| Check | Command | Looks right when |

| Hostname | openssl s_client -showcerts | CN and SAN contain the origin hostname |

| Expiry | echo | openssl s_client -showcerts -connect host:443 2>/dev/null | Certificate not yet expired |

| Chain | openssl s_client -verify_return_error -showcerts | Full chain is served |

  1. Enable TLS 1.2 and TLS 1.3 on the origin server and disable TLS 1.0 and 1.1. Most control panels expose this as a "minimum TLS version" setting.
  2. If a load balancer or reverse proxy terminates TLS, confirm it forwards SNI or matches the certificate to the correct virtual host instead of serving a default certificate with mismatched hostnames.
  3. Reload the web server and repeat the openssl check. Then test through Cloudflare with curl and look at the handshake output:
curl -v https://www.example.com/

Error family table

ErrorMeaning
521Origin refused the connection
522Origin connection timed out
523Origin unreachable
524Origin did not finish the response in time
525SSL handshake with the origin failed
526Origin SSL certificate is invalid
1016Origin DNS error (origin hostname cannot be resolved)

The 1016 code is worth keeping apart: it appears when Cloudflare cannot resolve the origin hostname in the record, which is a DNS problem rather than a TLS problem, and the 522 vs 523 guide covers that family.

Prevention

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services