A Cloudflare SSL handshake failure occurs when Cloudflare cannot complete a secure TLS connection with your origin server. The problem usually appears as Cloudflare Error 525, even when the website's visitor-facing SSL certificate appears to be working normally.

To identify the failure, test the origin's HTTPS connection, inspect its certificate and hostname configuration and check whether its TLS settings are compatible with Cloudflare. The objective is to establish where the handshake stops before changing SSL settings that may not be responsible.

What Error 525 Indicates

Cloudflare establishes a separate HTTPS connection with the origin server when the website uses Full or Full (Strict) encryption. Error 525 means the TLS handshake on that connection failed before Cloudflare could successfully exchange HTTP requests and responses with the origin.

The failure can occur even when the website has a valid visitor-facing SSL certificate. That certificate protects the connection between the visitor and Cloudflare, not necessarily the connection between Cloudflare and the hosting server.

The possible causes include:

  • HTTPS is not correctly configured on the origin server.

  • The origin does not present a usable TLS certificate.

  • The server does not support the expected hostname through SNI.

  • Cloudflare and the origin can not negotiate compatible TLS settings.

  • The origin rejects a required client certificate.

  • A server or load balancer intermittently terminates TLS connections.

These conditions require different corrections and changing the Cloudflare encryption mode does not necessarily repair any of them. The following troubleshooting sequence identifies the failing component before changes are made.

Trace the Failed TLS Connection

1. Confirm the Origin Configuration

Start by identifying the server Cloudflare actually connects to. A correct SSL certificate on another server will not resolve Error 525 if Cloudflare is sending requests to an outdated or incorrectly configured origin.

In the Cloudflare dashboard:

  1. Select the affected domain.

  2. Open SSL/TLS → Overview.

  3. Confirm whether the encryption mode is Full or Full (Strict).

  4. Open DNS → Records and inspect the affected hostname.

  5. Check whether an Origin Rule or load balancer changes the destination server or port.

Compare the configured destination with the origin address supplied by your hosting provider. If the website recently moved to another server, verify that Cloudflare is not attempting to establish TLS with the previous hosting environment.

If the destination is incorrect, update the relevant DNS or routing configuration and retry the affected URL. If it is correct, continue testing the origin's HTTPS service without changing unrelated settings.

Avoid switching to Flexible encryption merely to make Error 525 disappear. That changes how Cloudflare connects to the origin rather than correcting the failed TLS handshake.

2. Test HTTPS at the Origin

The next check determines whether the origin accepts HTTPS connections independently of Cloudflare's proxy. An HTTP-only service listening on the expected HTTPS port cannot complete the TLS handshake Cloudflare requires.

If you manage a Linux server, check whether a service is listening on port 443:

sudo ss -lntp | grep ':443 '

A listening process indicates that a service has opened the port. It does not establish that the service supports HTTPS or that its TLS configuration works correctly.

Test the origin directly with curl:

curl -v --resolve example.com:443:203.0.113.10 \
https://example.com/ -o /dev/null

Replace example.com with the affected hostname and 203.0.113.10 with the actual origin IP address. The example IP is reserved for documentation and is not a real hosting destination.

The command connects directly to the origin while preserving the hostname needed for HTTPS. Examine whether TLS negotiation completes and whether the server returns an HTTP response.

Important certificate distinction: If the origin uses a Cloudflare Origin CA certificate, curl may report that the certificate is not trusted by its local certificate store. This does not automatically mean the TLS handshake failed, because certificate trust verification and successful TLS negotiation are different checks.

When a trust warning occurs, inspect the TLS details rather than immediately replacing the certificate. A Cloudflare Origin CA certificate can work correctly between Cloudflare and the origin even though ordinary browsers and command-line clients do not trust its issuing authority.

Test resultWhat to check next
Connection refusedHTTPS listener and destination port
Connection timed outOrigin network access and firewall restrictions
TLS handshake failureCertificate, SNI and TLS settings
Certificate verification failureCertificate trust, hostname and validity
TLS succeeds and HTTP respondsDifferences between direct and Cloudflare connections

If the origin refuses the connection, verify that the HTTPS service is running on the intended port. Correct the listener configuration before repeating the same test.

If the connection times out, confirm that your testing environment is permitted to reach the origin. Some servers intentionally restrict direct connections to Cloudflare IP addresses, so an unsuccessful external test does not automatically establish an origin failure.

For applications running behind a reverse proxy, confirm that Cloudflare reaches an HTTPS-capable origin port rather than an HTTP-only application listener. If your application uses port 3000 internally, BusinessTally's guide to using port 3000 behind Cloudflare's proxy explains how an HTTPS reverse proxy can handle that connection.

If HTTPS is reachable but the TLS handshake still fails, examine the certificate and hostname configuration presented by the origin. The next check establishes whether the server selects the correct TLS configuration for the affected hostname.

3. Inspect the Certificate and SNI

A server may have a certificate installed but fail to present it correctly during TLS negotiation. This is particularly relevant when several hostnames share an IP address or the server uses different TLS configurations for different hostnames.

Use OpenSSL to inspect the origin:

openssl s_client -connect 203.0.113.10:443 \
-servername example.com -showcerts </dev/null

Replace the example values with the actual origin IP and affected hostname. The -servername option sends the hostname through Server Name Indication (SNI), allowing the origin to select the appropriate TLS configuration.

Examine the output for:

  • Whether the TLS handshake completes.

  • Whether a server certificate is presented.

  • Which certificate the server selects for the hostname.

  • Which TLS protocol and cipher are negotiated.

  • Whether OpenSSL reports a TLS alert or connection failure.

If the server closes the connection before presenting a certificate, check the HTTPS service configuration. Confirm that the correct certificate and private key are installed and available to the process handling the connection.

For Nginx, the relevant HTTPS configuration commonly includes:

listen 443 ssl;
server_name example.com;

ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/private.key;

These directives illustrate the settings to inspect, not a complete configuration to paste into an existing server. The certificate paths and hostname must match the files and configuration actually installed.

After correcting an Nginx configuration, validate it before reloading:

sudo nginx -t

If validation succeeds, apply the change using the server's supported service-management method. For an Nginx installation managed by systemd, the command is:

sudo systemctl reload nginx

When the Wrong Certificate Appears

If the server presents an unexpected certificate, inspect its SNI handling and HTTPS virtual-host configuration. Confirm that the affected hostname selects the intended server block instead of falling back to an unrelated default configuration.

A certificate verification warning does not automatically establish that the handshake failed. For example, a Cloudflare Origin CA certificate may complete the handshake successfully while appearing untrusted to tools that do not recognize Cloudflare's origin certificate authority.

If the TLS handshake succeeds but the certificate fails Cloudflare's validation requirements under Full (Strict), the problem may concern Error 526 rather than Error 525. Keep the investigation focused on whether the handshake completes and which failure occurs during negotiation.

If the origin presents its certificate and negotiates TLS successfully, continue to protocol and cipher compatibility testing. A successful connection from your computer does not guarantee that Cloudflare will negotiate the same settings.

4. Check TLS Protocols and Ciphers

Cloudflare and the origin must agree on a compatible TLS protocol and cipher suite. A server with outdated TLS software or unusually restrictive cipher settings may reject the handshake even when HTTPS is enabled.

Test the origin using TLS 1.2:

openssl s_client -connect 203.0.113.10:443 \
-servername example.com -tls1_2 -brief </dev/null

Then test TLS 1.3:

openssl s_client -connect 203.0.113.10:443 \
-servername example.com -tls1_3 -brief </dev/null

These examples assume that your installed OpenSSL version supports the specified protocol options. Replace the example address and hostname before running the commands.

Compare the results to determine which protocol versions the origin accepts.

ResultNext investigation
TLS 1.2 succeeds, TLS 1.3 failsCheck whether TLS 1.3 is supported and enabled
TLS 1.3 succeeds, TLS 1.2 failsCheck the origin's TLS 1.2 restrictions
Both failInspect the HTTPS listener, certificate and TLS configuration
No shared cipherCompare origin cipher settings with Cloudflare's supported suites
Both succeedInvestigate connection differences and origin-side authentication

A failure under one TLS version does not necessarily explain Error 525 if another compatible version works. The objective is to establish whether the origin supports a secure TLS configuration that Cloudflare can negotiate.

Correct an Incompatible Configuration

If the tests identify a protocol mismatch, inspect the server's allowed TLS versions and confirm that its software supports them. For Nginx, a modern configuration may include:

ssl_protocols TLSv1.2 TLSv1.3;

This is an example, not a correction required for every server. Review the active configuration and software compatibility before applying it.

If the server reports no shared cipher, compare its cipher configuration with Cloudflare's published origin cipher suites. Correct unsupported or unnecessarily restrictive settings without enabling obsolete protocols simply to force a connection.

After applying a confirmed correction, repeat the relevant OpenSSL tests and request the website through Cloudflare. If the handshake still fails, inspect the TLS error logs before making further changes.

5. Check Client-Certificate Authentication

If the origin supports HTTPS and compatible TLS settings but Cloudflare still encounters a handshake failure, check whether the server requires client-certificate authentication. This applies when Authenticated Origin Pulls or another mutual TLS configuration is enabled.

In Cloudflare, open the SSL/TLS origin-server settings and inspect the Authenticated Origin Pulls configuration. Confirm that the origin trusts the certificate authority associated with the client certificate Cloudflare is configured to present.

Look for the following mismatches:

  • The origin requires a client certificate that Cloudflare is not configured to present.

  • The origin trusts a different certificate authority.

  • A custom client certificate has expired or been replaced.

  • The TLS logs report client-certificate verification failures.

A direct-origin test without a client certificate may fail when mutual TLS is correctly enforced. That result alone does not establish a Cloudflare configuration problem.

If the logs confirm a client-certificate mismatch, correct the relevant trust configuration and repeat the request through Cloudflare. Do not permanently disable required client authentication as a workaround.

If Authenticated Origin Pulls is not enabled and the origin does not require client certificates, this check does not apply. Continue with the server logs and connection evidence rather than changing authentication settings unnecessarily.

When Error 525 Happens Intermittently

If the website sometimes loads normally and sometimes returns Error 525, investigate whether different origin servers are handling the requests. A load balancer may send one connection to an origin with correct TLS settings and another to a server with an outdated certificate or incompatible configuration.

Check the TLS configuration of every relevant origin, including its certificate, SNI handling, protocol support and client-authentication requirements. Compare the results rather than assuming that all servers share identical settings.

Inspect TLS Error Logs

For Nginx, inspect the server's error log:

sudo tail -n 100 /var/log/nginx/error.log

For Apache on Ubuntu or Debian, inspect the Apache error log:

sudo tail -n 100 /var/log/apache2/error.log

Your hosting platform may use different paths or provide logs through its control panel. Nginx and Apache may also require more detailed SSL logging to reveal the exact handshake failure.

Match the entries against the time Error 525 appeared. Look for protocol negotiation failures, rejected client certificates, missing shared ciphers or connections that terminate before TLS negotiation completes.

If the logs identify a particular server or configuration, correct that failure and repeat the affected request. When several origins are involved, verify each origin rather than relying on one successful page load.

If the Handshake Still Fails

If the origin completes your direct TLS tests but Cloudflare continues returning Error 525, collect evidence from the failed Cloudflare connection. The remaining problem may involve a TLS setting, destination server or authentication requirement that differs from your testing environment.

Record the following details:

  1. The affected hostname and URL.

  2. The failure timestamp and timezone.

  3. The Cloudflare Ray ID.

  4. The origin IP address and destination port.

  5. The configured Cloudflare SSL/TLS encryption mode.

  6. The OpenSSL test results and relevant TLS error logs.

Provide these details to your hosting provider and ask them to identify why the origin rejected or terminated Cloudflare's TLS handshake. If the website uses a load balancer or reverse proxy, its TLS logs may be needed in addition to the application server logs.

When the Origin Tests Successfully

If the provider confirms that the origin accepts TLS connections normally, compare the behaviour when Cloudflare is involved. Ask whether the origin rejected Cloudflare's protocol negotiation, selected a different TLS configuration or expected a client certificate that was not accepted.

Cloudflare's Origin Analytics may provide additional evidence when available. An originResponseStatus of 0 indicates that no origin HTTP response was recorded, which can occur when TLS negotiation fails, although this must be interpreted alongside caching information and origin logs.

If these checks still do not establish the cause, contact Cloudflare Support with the Ray ID, timestamp, hostname, origin details and relevant test results. This evidence is more useful than repeatedly switching between encryption modes without identifying the failed handshake.

A controlled proxy-bypass test may help compare connection paths but first verify that the origin can securely accept direct traffic. BusinessTally's guide to disabling Cloudflare without website downtime explains the certificate and firewall checks required before removing the proxy from a live website.

After correcting the identified problem, verify that the affected hostname loads through Cloudflare and that the origin no longer records failed TLS handshakes. For intermittent failures, repeat the tests across the relevant origins and compare the results under the conditions that previously produced Error 525.