Get a free Let’s Encrypt certificate for your origin server
A Cloudflare 525 error means Cloudflare reached your origin server but could not complete the TLS handshake. In practical terms, the visitor’s browser can connect securely to Cloudflare, while Cloudflare cannot establish a compatible encrypted connection to the web server behind it. An expired certificate, a missing certificate, an unsupported protocol, or a mismatch between the hostname and certificate can all cause the failure.
A free Let’s Encrypt certificate gives the origin a publicly trusted certificate that can work with Cloudflare’s Full (strict) encryption mode. That arrangement protects traffic between visitors and Cloudflare, then between Cloudflare and your server. It is suitable for Australian businesses running websites in Sydney, Melbourne, Brisbane, Perth, or on an overseas host serving customers in Australia.
Why Cloudflare returns a 525 error
Cloudflare uses the SSL mode selected in the dashboard to decide how it connects to the origin. With Flexible, the visitor-to-Cloudflare connection is encrypted but the Cloudflare-to-origin connection uses HTTP. This can avoid some certificate errors, but it leaves the server-side connection unencrypted and can create redirect loops.
Full encrypts both connections but does not require Cloudflare to validate the origin certificate. Full (strict) goes further: the origin must present a valid certificate, use a trusted certificate authority, and match the requested hostname. Let’s Encrypt satisfies these requirements when it is installed correctly.
The origin must also support a compatible TLS version and cipher suite. Modern web servers normally handle this automatically, but old operating systems, outdated control panels, or manually restricted configurations can interfere. A certificate for www.example.com will not automatically cover example.com unless both names are included in its Subject Alternative Names.
Before making changes, check whether the error affects every hostname or only one. A site hosted on an Australian NBN-connected office server may also be affected by changing public IP addresses, blocked inbound port 443, or a router forwarding HTTPS to the wrong internal machine.
Prepare the server and domain
Let’s Encrypt validates domain control through the ACME protocol. The most common method is an HTTP-01 challenge: the certificate client places a temporary file under /.well-known/acme-challenge/, and Let’s Encrypt retrieves it over port 80. The domain’s DNS records must point to the server where the certificate will be installed.
If Cloudflare proxies the DNS record, the request normally passes through Cloudflare and then reaches the origin. This can work, provided port 80 is open and the web server serves the challenge path without forcing it into an authentication system. If the origin is private, uses a firewall that blocks public validation, or has no usable HTTP service, use a DNS-01 challenge instead.
DNS-01 creates a TXT record under _acme-challenge. It is useful for wildcard certificates such as *.example.com and for servers that should not expose port 80. It requires access to the DNS provider’s API or a manual DNS update. Allow time for DNS propagation, particularly when records are managed through a third-party Australian registrar or hosting panel.
Stop testing through cached assumptions. Confirm the A and AAAA records, check that IPv6 points to the same service, and ensure the server answers for the intended hostname. A stale AAAA record can send Cloudflare to an unreachable IPv6 address even when the IPv4 configuration is correct.
Select the right certificate method
Certbot is the best-known ACME client and is widely available on Linux distributions. Many hosting panels, including cPanel and Plesk, offer an automatic Let’s Encrypt extension. Nginx Proxy Manager, Traefik, Caddy, and some managed Australian hosting platforms can request and renew certificates without a separate Certbot installation.
| Method | Best suited to | Main requirement | Renewal workload |
|---|---|---|---|
| Certbot with webroot | Nginx or Apache websites | Public HTTP challenge path | Low after setup |
| Certbot standalone | A server with no active web service | Temporary use of ports 80 or 443 | Moderate |
| DNS-01 with API | Wildcards or private origins | DNS provider API access | Low when automated |
| Hosting control panel | Shared or managed hosting | Panel support for Let’s Encrypt | Usually automatic |
| Caddy or similar proxy | New deployments and reverse proxies | Service manages HTTPS directly | Very low |
For a standard Linux virtual machine, the webroot method is usually the least disruptive. It leaves the existing web server running and places the challenge file in its document root. A typical command for Nginx or Apache is:
sudo certbot certonly --webroot \
-w /var/www/example \
-d example.com \
-d www.example.com
Replace the document root and names with the actual values. Certbot stores the resulting files under /etc/letsencrypt/live/example.com/. The private key should remain readable only by the required service accounts. Never paste it into a ticket, chat room, or shared deployment note; teams that coordinate through Telegram can keep operational guidance separate from secrets using an archive feature guide.
Install the certificate at the origin
Requesting a certificate is only half the job. Configure the web server’s HTTPS virtual host to use the certificate chain and private key. For Nginx, the relevant settings commonly look like this:
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
Apache uses equivalent SSLCertificateFile and SSLCertificateKeyFile directives. The fullchain.pem file is important because it supplies the server certificate and intermediate chain that clients need to build trust. Using only cert.pem can produce incomplete-chain errors.
After editing the configuration, test it before reloading:
sudo nginx -t
sudo systemctl reload nginx
For Apache, use sudo apachectl configtest followed by a graceful reload. Confirm that the certificate includes the exact hostname Cloudflare uses. If Cloudflare sends requests to origin.example.com, a certificate valid only for example.com may not satisfy strict verification.
Set Cloudflare’s SSL/TLS mode to Full (strict) after the origin serves a valid certificate. Then check for HTTP-to-HTTPS redirect loops, incorrect proxy ports, and firewall rules that allow Cloudflare traffic. Do not broadly expose administrative ports simply to fix a web certificate; limit access to ports 80 and 443 and use a controlled management path for SSH or panel access.
Automate renewal and verify the handshake
Let’s Encrypt certificates normally expire after 90 days, so manual renewal is a poor long-term operating model. Certbot usually installs a systemd timer or cron job. Test the renewal process without issuing a real replacement certificate:
sudo certbot renew --dry-run
A successful dry run confirms that the validation path, DNS records, permissions, and renewal hooks are functioning. If Nginx or Apache must reload after renewal, configure a deploy hook or the integration supplied by the hosting panel. Check the timer logs after the first scheduled run rather than assuming automation is active.
Useful verification tools include:
openssl s_client -connect example.com:443 -servername example.com
The -servername option matters because many servers host multiple HTTPS sites on one IP address. Online TLS scanners can reveal an expired chain, unsupported protocol, hostname mismatch, or an incomplete intermediate certificate. Test both the public hostname and the direct origin hostname where appropriate.
For a local business, perform a real-world check from more than one network: an office connection in Melbourne, a mobile connection in regional New South Wales, or a monitoring point outside Australia. This can reveal DNS differences, an ISP route issue, or a broken IPv6 path. If a separate hostname needs checking, confirm its ownership and DNS destination through a suitable domain reference before issuing a certificate.
Keep the following operational safeguards in place:
- Include every required hostname in the certificate request.
- Keep port 80 available when using HTTP-01 validation.
- Use DNS-01 for wildcard names or private origin servers.
- Schedule and test automatic renewal before the 90-day expiry.
- Protect
privkey.pemwith restrictive file permissions. - Reload the web server after a successful certificate renewal.
- Keep Cloudflare on Full (strict) once origin TLS is working.
A 525 error should disappear when Cloudflare can negotiate TLS, validate the certificate chain, and reach the correct virtual host. Install the certificate on the origin, run the dry-run renewal test, verify the hostname with SNI, and then leave Full (strict) enabled. These steps provide a durable HTTPS path for Australian customers instead of relying on a temporary Cloudflare setting.