Cloudflare Error 525: SSL Handshake Failed
August 2026 · Uptimehub
Checked from regions with auto-retry. No single-location false alarms.
All systems operational. Steady pulse across every region.
api.example.com returned no response from all 6 regions. Auto-retry confirmed the outage, then we alerted your team.
api.example.com is back up. The incident is logged to your status page history automatically.
90-day uptime · branded · your domain
Live demo · drive it, no signup needed
Cloudflare error 525 means the TLS handshake between Cloudflare and your origin server failed, so no encrypted connection was ever established. Cloudflare's own documentation lists four causes: no valid SSL certificate at the origin, port 443 closed, no SNI support, and cipher suites the two ends cannot agree on. It only appears when your SSL/TLS mode is Full or Full (Strict), because those are the only modes where Cloudflare speaks TLS to your origin at all. The fastest way to confirm it is to run one openssl command against your origin IP directly, bypassing Cloudflare entirely.
What does Cloudflare error 525 mean?
The error page reads "SSL handshake failed" and marks the host as the problem. What Cloudflare is saying is precise: it opened a TCP connection to your origin on port 443, started a TLS negotiation, and the negotiation did not complete. No HTTP request was ever sent, because there was no secure channel to send it over.
That distinction matters for diagnosis. A 525 is not an application error. Your web framework never ran, your database was never queried, and nothing will appear in your application log, because the request never reached the layer that writes to it. The failure happened during the few round trips where the two ends agree on a protocol version, a cipher, and a certificate. Everything you need is in the TLS layer, which is a much smaller place to look than an entire stack.
It also tells you the network is fine. Cloudflare reached your server and your server accepted the connection. If it had not, you would be looking at a 521 (connection refused) or a 522 (connection timed out) instead. The route works, the firewall let the packet through, and something is listening. The two ends simply cannot agree on how to encrypt.
What causes Cloudflare error 525?
Cloudflare publishes four causes and they cover almost every real case. They are worth reading literally, because each one fails in a recognisably different way.
| Documented cause | What is actually happening | The signature that identifies it |
|---|---|---|
| No valid SSL certificate installed at the origin | The origin is listening on 443 but has no certificate to present, or presents one the TLS library refuses to load | Site-wide and constant. Started the moment SSL mode was switched to Full, or when a certificate was removed rather than renewed |
| Port 443, or your custom secure port, is not open | Nothing is listening on the port Cloudflare is dialling, or a firewall drops it while leaving port 80 open | Site-wide, and the site works fine in Flexible mode because that talks to port 80 |
| The origin does not support SNI | Cloudflare sends the hostname during the handshake so the origin can pick the right certificate. An origin that ignores SNI serves the default virtual host certificate, or nothing | Only some hostnames fail. One domain on a shared IP works, another on the same IP does not |
| Incompatible cipher suites | Cloudflare and the origin share no cipher or TLS version both will accept, so the negotiation ends before a certificate is even exchanged | Appeared after an origin hardening change, a TLS version being disabled, or an operating system upgrade that dropped old ciphers |
There is a fifth cause that is not on Cloudflare's list but shows up constantly in practice: certificate renewal that half worked. A cron job fetches a new certificate, writes it to disk, and never reloads the web server, or reloads it while the chain file is incomplete. The process is running, the port is open, and the certificate on disk is valid, but the running process is holding something broken in memory. A reload fixes it in a second and the cause never gets recorded.
Why SNI breaks more often than the certificate does
Server Name Indication is the part of the handshake where the client says which hostname it wants before any certificate is chosen. It exists because one IP address can host many sites, and the server has to know which certificate to present.
Cloudflare always sends SNI. Most modern origins handle it without being asked. The ones that do not are usually older load balancers, appliance-style products with a fixed TLS front end, or a virtual host configuration where a catch-all block with no certificate ends up matching first. When that happens the origin either presents a certificate for a completely different domain or aborts the handshake, and you get a 525 on exactly one hostname while the neighbouring site on the same server is fine.
525 vs 526: the difference that decides the fix
These two are constantly confused and the distinction is exact. Both are documented by Cloudflare and they describe different moments in the same conversation.
| Error 525 | Error 526 | |
|---|---|---|
| What Cloudflare says | SSL handshake failed | Invalid SSL certificate |
| What happened | The handshake never completed | The handshake completed and Cloudflare rejected the certificate it was shown |
| Was a certificate seen? | Often not at all | Yes, and it failed validation |
| SSL modes it can occur in | Full and Full (Strict) | Full (Strict) only |
| Typical root cause | Port closed, no SNI, no cipher overlap, no certificate present | Expired, revoked, self-signed, wrong hostname, or an incomplete chain |
| Does switching to Full fix it? | No. Full still requires a working handshake | Yes, though it downgrades your security posture |
The last row is the practical one. Full mode encrypts the Cloudflare to origin hop but accepts any certificate, including a self-signed or expired one. Full (Strict) encrypts it and validates the certificate properly. So a 526 can be made to disappear by dropping to Full, which is why it so often is, and why so many origins quietly run on expired certificates behind Cloudflare. A 525 cannot be made to disappear that way, because both modes need the handshake itself to succeed.
Cloudflare's documented requirements for passing Full (Strict) validation are worth keeping as a checklist. The certificate must not be expired or revoked, it must be signed by a trusted certificate authority rather than self-signed, the domain must match the Common Name or a Subject Alternative Name, the full chain must be present, and the server must be listening on port 443. If you need to keep a self-signed certificate, Cloudflare's Custom Origin Trust Store and its free Origin CA certificates both exist for exactly that case.
Which SSL mode can produce which error
Half of all 525 confusion comes from not knowing what the SSL/TLS mode actually changes. It sets which port Cloudflare dials and how hard it checks what it finds there.
| SSL/TLS mode | Cloudflare connects to the origin on | Validates the certificate? | Can it produce 525? | Can it produce 526? |
|---|---|---|---|---|
| Off | Port 80, unencrypted | No certificate involved | No | No |
| Flexible | Port 80, unencrypted | No certificate involved | No | No |
| Full | Port 443, encrypted | No, any certificate is accepted | Yes | No |
| Full (Strict) | Port 443, encrypted | Yes, fully | Yes | Yes |
This table explains the single most common way a 525 arrives: nothing broke, somebody changed the mode. A site that has been happily running in Flexible mode for two years has never had its port 443 tested by Cloudflare even once. Switch it to Full for the perfectly good reason that Flexible leaves the origin hop unencrypted, and the first thing that happens is a site-wide 525, because port 443 was never configured at all. The change was correct. The origin was simply not ready for it.
How to fix Cloudflare error 525
Work down this list in order. It moves from the tests that take seconds to the ones that need a config change, and each step rules something out.
1. Test the origin's TLS directly, bypassing Cloudflare
This is the single most useful command, because it reproduces what Cloudflare is doing without Cloudflare in the way. Replace the IP with your real origin address:
openssl s_client -connect 203.0.113.10:443 -servername example.com
If that returns a certificate chain and a handshake summary, TLS works and your 525 is intermittent or specific to certain Cloudflare edge locations. If it hangs, port 443 is filtered. If it refuses instantly, nothing is listening. If it errors with a handshake failure, you have reproduced the problem locally and can now iterate quickly.
Run it a second time without -servername. If it succeeds without the hostname and fails with it, SNI is your cause and you have found it in two commands. That is the whole diagnosis for one of the four documented causes, and it takes about twenty seconds.
2. Confirm the port is actually open from outside
Checking locally on the server is not the same test. A service bound to 127.0.0.1 answers a local check perfectly and is unreachable from the internet. Cloud provider security groups are the usual culprit here, since port 80 gets opened during setup and port 443 gets forgotten until the day something needs it.
3. Check the certificate is present and loaded
Confirm the file exists, that it has not expired, and crucially that the running process has reloaded since it last changed. If a renewal ran this morning, reload the web server before investigating anything else. Cloudflare will issue a free Origin CA certificate if you do not want to manage a public one for a server that only ever talks to Cloudflare, and it lasts up to fifteen years, which removes the renewal failure mode entirely.
4. Review the cipher suites and TLS versions
If the handshake fails but a certificate exists and SNI works, this is what is left. Hardening guides that disable everything below TLS 1.3, or an old origin that offers nothing above TLS 1.0, both produce a negotiation with no common ground. The fix is to make sure the origin offers a modern, mainstream set rather than an unusually narrow one in either direction.
5. Read the origin's TLS error log, not the access log
A failed handshake never becomes a request, so the access log will show nothing at all and can make it look as if Cloudflare is not reaching you. The error log is where the handshake failure is recorded. Cloudflare's guidance is to enable mod_ssl error logging on Apache or raise the log level on nginx, then match the timestamps against the 525s.
6. Use Origin Analytics to confirm it is TLS
This is the least-known step and the most conclusive. In Cloudflare's Origin Analytics, a TLS negotiation that failed is recorded with an originResponseStatus of 0, meaning the origin never produced a status code at all. If you are seeing a mix of errors and are not sure how many are really handshake failures, that field separates them cleanly.
Where 525 sits in the 52x family
Cloudflare's 52x codes are a fault-attribution system. Each one tells you how far the conversation got before it broke, and reading them in order is faster than treating each as a separate mystery.
| Error | How far the connection got | Where to look first |
|---|---|---|
| 520 | Connected, exchanged data, and the response was not valid HTTP | The application. A crash mid-response, or headers over the 128 KB limit |
| 521 | Refused. The origin actively rejected the connection with an RST | The web server is stopped, or a firewall REJECT rule |
| 522 | Timed out. No response to the connection attempt at all | A firewall DROP rule, wrong origin IP, or an overloaded server |
| 523 | The origin was unreachable. Cloudflare could not route to it | DNS records pointing at an address that no longer exists |
| 524 | Connected and the request was accepted, but no response arrived in time | A slow query or long-running request at the origin |
| 525 | Connected, and the TLS handshake failed | Certificate, port 443, SNI, or cipher suites |
| 526 | Connected, handshake completed, certificate rejected | Expired, self-signed, wrong hostname, or an incomplete chain |
Read down the "how far" column and the family stops looking arbitrary. 523 means Cloudflare could not find your server. 521 and 522 mean it found it and was turned away, loudly in one case and silently in the other. 525 and 526 mean it got in the door and the encryption negotiation failed. 520 and 524 mean the encrypted conversation worked and your application let it down. For the ones either side of 525, we have full write-ups on Cloudflare error 521, error 522 and error 520.
How to stop 525 happening again
Almost every 525 that is not a one-off configuration change comes down to a certificate nobody was watching. The renewal cron fails silently in March, nothing changes for sixty days because the certificate is still valid, and the site breaks on a Saturday. By then the change that caused it is far enough back that nobody connects the two. Reading the live certificate with an SSL certificate checker shows you the expiry date and chain in a few seconds, and that window is closing: the maximum certificate lifetime is already down to 200 days and drops to 47 by 2029, which is covered in certificate lifetime changes.
The fix is unglamorous: watch the expiry date as a monitored value rather than as something the automation is assumed to handle. A check that connects to your origin on 443, reads the certificate and alerts at thirty and seven days turns a Saturday outage into a Tuesday ticket. That is what SSL certificate monitoring is for, and it is worth pointing at the origin hostname directly rather than only at the Cloudflare-facing domain, because the certificate Cloudflare serves your visitors is not the certificate that causes a 525. Those are two different certificates and only one of them is yours to renew.
It is also worth logging the renewal as something you can evidence, not just something that works. Encryption in transit is a control that every mainstream security framework asks about, and "the certificate is current" is much easier to demonstrate when there is a dated record of it rather than a shrug at a cron job, which is the sort of ongoing obligation that compliance tracking software exists to keep visible. The audit value is a side effect. The real one is that an expiry you are tracking is an expiry that does not surprise you.
Two smaller habits help as much. Test port 443 from outside after any firewall or security group change, since that is when it silently closes. And when you switch SSL mode, do it during working hours, because a mode change is the most common way a perfectly healthy site produces a site-wide 525 within seconds.
Frequently asked questions about Cloudflare error 525
How do I fix Cloudflare error 525?
Run openssl s_client -connect ORIGIN_IP:443 -servername yourdomain.com against your origin to reproduce the handshake outside Cloudflare. If it fails, work through the four documented causes in order: confirm port 443 is open from the internet, confirm a valid certificate is installed and the web server has been reloaded since it changed, test whether the handshake succeeds without SNI, and check that the origin offers mainstream TLS versions and cipher suites.
Is error 525 a problem with Cloudflare or my server?
Your server, in almost every case. Cloudflare reached it and started a TLS handshake, which means DNS, routing and the network path all worked. The negotiation failed at the origin end, so the certificate, the listening port, the SNI configuration or the cipher list is where the fault is. Cloudflare marks the host as the failing component on the error page for this reason.
What is the difference between error 525 and error 526?
525 means the TLS handshake never completed. 526 means it completed and Cloudflare rejected the certificate it was given as invalid. 525 can occur in both Full and Full (Strict) SSL modes, while 526 only occurs in Full (Strict), because Full does not validate certificates. Switching to Full will clear a 526 and will not clear a 525.
Why do I get error 525 with nginx?
Usually because a server block is not listening on 443 with ssl, or because a catch-all block without a certificate is matching the request before the correct one does. The second case is the nginx-specific version of the SNI problem: nginx picks the default server for the port when no server name matches, and if that default has no certificate the handshake fails. Check which block is actually selected before assuming the certificate is at fault, and reload after every certificate change.
Can error 525 be caused by an expired certificate?
Usually not directly. An expired certificate that is still served produces a 526 in Full (Strict) mode, because the handshake completes and validation then fails. An expired certificate causes a 525 when the renewal process broke in a way that left no usable certificate for the web server to load at all, which is a different and more common failure than the certificate simply passing its expiry date.
Does Cloudflare error 525 affect SEO?
Yes, if it lasts. Googlebot receives the same 525 your visitors do, and a persistent server error will eventually cause affected URLs to be dropped from the index. A short incident is normally recovered from without lasting harm, since Google retries. The practical risk is not a single outage but a certificate that expires unnoticed and leaves the site erroring for days, which is the scenario worth monitoring against.
How long does it take for error 525 to resolve after fixing the origin?
Immediately. Cloudflare does not cache 525 responses, and it attempts a fresh handshake on the next request. If you have fixed the origin and are still seeing the error, the handshake is still failing, so re-run the openssl test rather than waiting. The one thing worth allowing time for is a certificate change that has not been picked up because the web server was never reloaded.
Know your site is down before your customers do
Start monitoring your sites, APIs and services from six regions, with alerts by Slack, email, SMS and webhook and a branded status page. Transparent, flat pricing per monitor.