Verifying SSL certificates for Cloudflare IP ranges

A Cloudflare 525 response means the visitor reached Cloudflare, but Cloudflare could not complete the TLS handshake with the origin server. It is a server-side fault rather than evidence that the public certificate on Cloudflare’s edge is invalid. The first task is to identify which side of the proxy owns the broken handshake.

Certificates are attached to hostnames, not to broad sets of IP addresses. A valid certificate must match the requested domain, rely on a trusted chain, fall within its validity dates and satisfy the certificate mode configured for the origin. Checking only an IP address can miss the hostname mismatch that actually breaks a connection.

The following checks work for a .com.au website, an Australian ecommerce store or another proxied service. They distinguish an edge-certificate test from an origin-certificate test, include IPv4 and IPv6 ranges and record evidence for a local hosting provider without changing DNS unnecessarily.

Understand which IP addresses matter

Cloudflare publishes separate IPv4 address ranges and IPv6 address ranges. When a proxied visitor reaches a Cloudflare edge, the origin normally sees traffic from Cloudflare source addresses rather than the visitor’s address. These feeds therefore matter for origin firewall rules and allow lists.

They do not define the names that an origin certificate must contain. Nor should an origin certificate list every Cloudflare edge IP as a subject alternative name. The hostname configured in Cloudflare and presented through the TLS server name indication, or SNI, is what the certificate must cover.

Think of two independent checks: a public request to the hostname tests Cloudflare’s edge certificate, while a direct connection to the origin using the same SNI hostname tests the certificate Cloudflare sees. This distinction prevents a healthy edge certificate from hiding a broken origin certificate, and vice versa.

Check the Cloudflare edge certificate

Choose an address from the published range feed, then connect to that address while preserving the site hostname. This example demonstrates the required parameters; replace both placeholder values with values from the active DNS and range records:

CF_IP="<Cloudflare IPv4 address>"
HOST="www.example.com.au"

openssl s_client -connect "${CF_IP}:443" -servername "$HOST" \
  -verify_hostname "$HOST" -verify_return_error -showcerts

OpenSSL should report successful verification, a trusted chain and a notAfter date in the future. The certificate should include the exact hostname in its subject alternative name list. A wildcard such as *.example.com.au covers one label only, so it matches www.example.com.au but not shop.example.com.au.

Repeat the check with an IPv6 address if the service publishes AAAA records. Then make an ordinary HTTPS request to confirm that DNS, host routing and HTTP negotiation work with the same certificate. If a direct-by-IP test returns a default certificate, repeat it with SNI before drawing a conclusion.

Validate the certificate at the origin

Cloudflare’s Full (strict) mode requires a valid origin certificate with correct hostname coverage. Full mode encrypts the origin leg but accepts an invalid certificate, while Flexible mode uses HTTP to the origin. A 525 commonly requires investigation in Full or Full (strict), although protocol, cipher and firewall problems can produce the same symptom.

Connect directly to the origin address while retaining the hostname through SNI:

HOST="www.example.com.au"
ORIGIN_IP="<origin IPv4 address>"

openssl s_client -connect "${ORIGIN_IP}:443" -servername "$HOST" \
  -verify_hostname "$HOST" -verify_return_error -showcerts

The result should show a publicly trusted certificate for the hostname. If the design uses a Cloudflare Origin CA certificate, verify it against Cloudflare’s Origin CA trust bundle; a local browser or curl command may reject it even though Cloudflare’s Full (strict) connection succeeds. Record the issuer, chain, SANs and validity dates. This is a different layer from message-level encryption, a distinction reinforced by this secure messaging comparison; transport authentication does not prove that application data has end-to-end protection.

Separate TLS, DNS and firewall checks

Distinguish adjacent failures. Error 525 reports a failed handshake, 526 indicates that Cloudflare regards the origin certificate as invalid, and 522 concerns reaching the origin. DNS can resolve perfectly while routing the request to an unreachable or misconfigured backend.

Use DNS queries to compare the proxied hostname with the origin address recorded in Cloudflare. A grey-cloud, DNS-only record can expose an origin directly, which is useful for testing but may bypass the edge and should only be used briefly. A request to curl --resolve with the origin IP can also preserve SNI and the HTTP host header without changing the public record.

If the origin firewall permits only Cloudflare traffic, a direct test may time out even when the certificate is sound. Check ingress logs for Cloudflare source addresses, allow both IPv4 and IPv6 ranges where relevant and keep administrative access on a separate path. A firewall block cannot be repaired by adding Cloudflare IPs to the certificate SAN list.

Test from Australian network locations

Australian networks make geographic testing useful. Sydney and Melbourne host major cloud regions, while Perth and Brisbane can take a materially different path to the same origin. Test the hostname from each city and compare TLS results, DNS answers, redirects and latency instead of treating a fast Sydney result as complete coverage.

Cloudflare’s edge may terminate the visitor’s connection close to the user, but the edge-to-origin route still depends on where the origin is hosted. An Australian origin and an overseas origin can therefore produce different performance and firewall behaviour even when edge certificates pass everywhere.

Plan cutovers around Australian Eastern Time, including its daylight-saving shift. For a renewal window, calculate the interval with a days between dates tool and leave room for validation and rollback. When an Australian customer says the site is “playing up”, the evidence should show whether the fault follows the edge, the origin or the path between them.

Run a practical verification routine

Run the routine in a fixed order so each result removes one uncertainty. Keep timestamps, chosen Cloudflare IPs, hostname and command output together. Changing DNS and certificate settings simultaneously makes a successful recovery difficult to interpret.

Start with public DNS and edge behaviour:

Check the origin and network perimeter:

A pass requires both sides to present an acceptable certificate for the same hostname. The edge result then proves that visitors receive valid encryption, while the origin result confirms that Cloudflare can complete the secure connection it initiates.

Restore service with a controlled rollout

After the checks, make one reversible change at a time. If the edge certificate passes but the origin does not, correct the origin SAN, chain or trust configuration before altering Cloudflare’s mode. If both pass, inspect firewall logs and the exact TLS alert returned by the origin.

Check How to test it Expected evidence Common mistake
Cloudflare edge Connect to a published Cloudflare IP using the production hostname as SNI Valid chain, dates and hostname coverage Expecting the certificate subject to contain every Cloudflare IP
Proxied hostname Make a normal HTTPS request and load the site in a browser DNS, edge certificate and HTTP routing all succeed Testing only the origin and overlooking the public path
Origin certificate Connect directly to the origin IP with the production hostname as SNI Public CA certificate or Cloudflare Origin CA certificate accepted by the intended verifier Omitting SNI, so the server returns its default certificate
Origin perimeter Compare ingress logs with Cloudflare’s current published ranges Requests arrive from allowed Cloudflare source addresses Mistaking a firewall timeout for an invalid certificate

Use the comparison to identify the failing layer before touching production. Replace one certificate, DNS setting or firewall rule at a time, retest from an Australian connection and retain a rollback path for each change.

Run the edge and origin checks now, save the evidence with timestamps and restore the proxied site only after the hostname, chain, validity dates and firewall access all pass.