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
- ·Ordered fix steps
- ·Verify checklist
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
- The origin is listening on plain HTTP on port 443, so there is no TLS endpoint for Cloudflare to negotiate with.
- The origin web server failed to bind its certificate, for example a stopped service, missing file, or failed reload.
- The origin certificate is for a different hostname. Cloudflare sends SNI matching the proxied host, and a strict origin that cannot match the name aborts the handshake.
- The origin certificate is expired, revoked, or bundled with an incomplete chain.
- The origin only offers TLS 1.0 or 1.1, or cipher suites that modern clients and the Cloudflare edge no longer enable.
- A firewall or host-level rule drops the ClientHello, so the failure looks like SSL even though it is a packet drop.
- The Cloudflare SSL mode is set to Full or Full strict while the origin serves HTTP only, or Flexible while the origin serves HTTPS only.
Ordered fixes
- 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 |
- 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.
- 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 |
- 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.
- 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.
- 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
| Error | Meaning |
|---|---|
| 521 | Origin refused the connection |
| 522 | Origin connection timed out |
| 523 | Origin unreachable |
| 524 | Origin did not finish the response in time |
| 525 | SSL handshake with the origin failed |
| 526 | Origin SSL certificate is invalid |
| 1016 | Origin 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
- Keep the SSL mode aligned with the origin certificate type, and re-check it after any hosting move or certificate renewal, since a mode change alone can trigger 525 or 526.
- Add a TLS check to your deploy script so certificate expiry or a lost bundle is caught before the site broadcasts the error.
- Confirm the host firewall allows the Cloudflare edge IP ranges (covered in the 521 firewall guide), because a dropped ClientHello surfaces as a handshake failure rather than a clean TCP refusal.