Cloudflare Error 526 (Invalid SSL Certificate): Causes and a Tested Fix
Error 526 (Invalid SSL certificate) means Cloudflare reached your origin server (the real server behind Cloudflare) over HTTPS but could not validate the SSL certificate it presented, while your SSL/TLS encryption mode is set to Full (strict). Both have to be true. Typical certificates that fail are self-signed, expired or issued for a different hostname. Cloudflare and the visitor’s browser are working; the certificate on the server is the problem.
If you are only visiting a site that shows error code 526, there is nothing to fix on your side: the site owner has to fix the server’s certificate. If it is your site, below I show how I caused error 526 on a test server, how my zone ended up in Full (strict) without me noticing, what changed when I switched to Full, and the commands that find and fix the certificate.
Tested by Dolon Bepari, 20 November 2026
- Server: a throwaway Ubuntu 22.04 VPS (1 vCPU, about 2 GB RAM), aaPanel 7, Nginx 1.30.7, PHP 8.4, WordPress
- Cloudflare: Free plan, orange cloud (proxied), SSL/TLS mode switched between Full (strict) and Full for the test, test domain filecafe.site
- How I measured: curl and a browser from my PC in Dhaka, Bangladesh, through Cloudflare, plus commands on the server itself
- There are no affiliate links in this guide. How I test: how we review
Table of Contents
What error code 526 means
Error 526 is a Cloudflare status code, not a standard HTTP one. Cloudflare’s error 526 page (last updated 12 October 2026) says it appears when Cloudflare cannot validate the SSL certificate on your origin web server and Full (strict) is set in SSL/TLS, Overview. The browser page calls it Invalid SSL certificate, so searches for “invalid ssl certificate error code 526” and “http error 526” are about the same problem.
“Validate” means three checks, listed on Cloudflare’s Full (strict) page: the certificate is inside its valid dates, it was issued by a publicly trusted certificate authority or by Cloudflare’s own Origin CA, and its Common Name or a Subject Alternative Name (the list of domain names a certificate covers) matches your hostname. Fail any one and you get 526.

The red Host box points at your server. A 526 does not mean the server is down (error 521) or not answering (error 522): Cloudflare connected, started HTTPS, looked at the certificate and refused to trust it.
Is error 526 your fault? Visitor vs site owner
If you are a visitor, no. Clearing your cache, changing browsers or restarting your router will not help, because the certificate Cloudflare rejects is on the website’s server. If a game or an app shows a 526 with Cloudflare’s Invalid SSL certificate wording, it works the same way: it comes from that service’s servers. Wait and try again later, check the service’s status page, and if it is a website, tell the owner and include the Ray ID, the short reference code Cloudflare prints at the bottom of its error pages.
If you own the site, the fix is on your server or in one Cloudflare setting. Either the certificate on the server is not one Full (strict) accepts, or your zone is in Full (strict) when you thought it was not. Upgrading your Cloudflare plan changes neither. The rest of this guide is for you.
How I reproduced error 526 (and what I measured)
Most error 526 guides list causes without ever making the error happen. I caused it on purpose on a throwaway VPS that I deleted afterwards, running WordPress on a test domain proxied through Cloudflare’s Free plan.

The origin had a self-signed certificate
The certificate Nginx served for filecafe.site was self-signed: its issuer and its subject were the same name, CN = filecafe.site, and it was valid from 20 November 15:46:16 to 27 November 15:46:16 2026 GMT. When I asked curl on the server to verify it, curl refused with error 60, SSL certificate problem: self-signed certificate. Cloudflare makes a similar check in Full (strict), and a self-signed certificate fails it too.

Full (strict): 526 every time
From my PC, I requested a small test file through Cloudflare three times with the zone in Full (strict). All three came back as 526, in 0.37, 1.25 and 0.27 seconds. The second request was slower; I did not measure why, so I will not guess. Either way the error is fast: Cloudflare rejects the certificate while connecting and answers right away, with no long timeout.

Full: 200 with the same certificate
Then I switched the mode to Full and sent the same three requests. Nothing changed on the server and the certificate was still self-signed, yet all three returned 200, in 0.81, 0.30 and 0.32 seconds. In Full (strict) every request returned 526; in Full the same requests returned 200. That is the whole difference: Full encrypts the connection to your server but does not check the certificate at all.

The surprise: my zone was in Full (strict), not Full
None of the top-ranking guides I read mention Automatic SSL/TLS. When I started, the zone was on Full, with automatic mode disabled. During setup, Automatic SSL/TLS got switched on by mistake. I still believed the zone was on Full, so the 526 page above confused me at first.

The SSL/TLS overview explained it. The current mode was Full (strict), and under it Cloudflare showed Automatic mode enabled. With automatic mode on, Cloudflare is meant to choose the encryption mode itself. The same page said the mode last changed 1 hour ago, while automatic mode had been enabled only 19 minutes ago, so my screenshots do not show what set strict, and I will not guess. Either way, strict was the one mode my self-signed certificate could not pass.

To take control back, I opened Configure on the same page, chose Custom SSL/TLS and picked Full myself. The overview then showed Full with automatic mode disabled. If you get 526 while you are sure you chose Full, check this first: the mode shown on the overview page is the one Cloudflare uses, not the one you remember.

The real fix: a certificate Full (strict) accepts
Switching to Full only hides the problem. The proper fix is a certificate that passes Full (strict). On the same server I installed a free Cloudflare Origin CA certificate, set the zone back to Full (strict), and the same three requests returned 200 in 0.37, 0.27 and 0.20 seconds. How to create and install one is in step 4 below.
Full vs Full (strict): what each SSL mode checks
| SSL/TLS mode | Encrypted between Cloudflare and your server? | Certificate checked? | Self-signed certificate in my test |
|---|---|---|---|
| Flexible | No, plain HTTP to your server | No certificate used | Not tested (not recommended) |
| Full | Yes | No: any certificate passes, even self-signed or expired | 200 |
| Full (strict) | Yes | Yes: valid dates, trusted issuer or Cloudflare Origin CA, matching hostname | 526 |
Full is the quick fix Cloudflare itself suggests on its 526 page, but its Full mode page says the certificate is not validated in any way, which leaves the connection between Cloudflare and your server open to interception. Use Full to confirm the diagnosis or to keep a site online for a short time, then fix the certificate and go back to Full (strict).
Do not drop to Flexible. It removes encryption between Cloudflare and your server entirely, and on WordPress it often causes redirect loops if the server or WordPress forces HTTPS. I reproduced two of those loops in my Cloudflare too many redirects test.
What causes error 526
These are the causes in Cloudflare’s 526 documentation, which I checked on 21 November 2026. I reproduced the self-signed one; the others are Cloudflare’s descriptions, not my tests.
- The certificate is self-signed. No trusted authority vouches for it. This was my lab: 526 in Full (strict), 200 in Full. Cloudflare can accept a self-signed certificate if you add it to its Custom Origin Trust Store (step 5).
- The certificate has expired or was revoked. Not tested. Step 3 shows the
notAfterdate, the last day the certificate is valid. - Your hostname is not on the certificate. Not tested. For example, a certificate for example.com used on www.example.com, or a server that sends another site’s certificate because yours has none.
- The certificate chain is incomplete. Not tested. The server sends its own certificate without the intermediate certificate that links it to a trusted authority.
- The origin does not accept connections on port 443. Cloudflare lists this check too. On my test server in Full (strict), a refused connection gave error 521 and silently dropped packets gave error 522, not 526, so if your code changes, follow those guides.
Add one trigger from my own test: the zone being in Full (strict), with Automatic SSL/TLS on, while I believed it was on Full and the server still had a certificate that only Full accepts.
How to fix error 526 on Nginx and aaPanel, step by step
Every command below says where to run it and what it does. Only the ones marked “changes” modify anything. Replace example.com with your domain. Where aaPanel differs from a standard Nginx install, I say so.
Step 1: Confirm the 526 and how fast it fails
▶ On your own computer, in Windows cmd (not PowerShell). On Mac or Linux, use curl instead of curl.exe, /dev/null instead of NUL, and ; instead of & between the three commands:
curl.exe -sS -o NUL -w "%{http_code} %{time_total}\n" https://example.com/ & curl.exe -sS -o NUL -w "%{http_code} %{time_total}\n" https://example.com/ & curl.exe -sS -o NUL -w "%{http_code} %{time_total}\n" https://example.com/
What it does: requests your homepage through Cloudflare three times and prints the status code and total time for each (-S makes curl still show an error if one happens). It changes nothing. The 526 code itself tells you Cloudflare connected and rejected the certificate; in my test it came back in 0.27 to 1.25 seconds, with no long timeout like a 522. If you see 520, 521 or 522 instead, the cause is different; follow that error’s guide. A 525 is covered in the 526 vs 525 section below.
Step 2: Check which SSL/TLS mode Cloudflare really uses
No command here. In the Cloudflare dashboard, open your domain, then SSL/TLS, Overview, and read the current encryption mode and the line under it. If it says Automatic mode enabled, Cloudflare is choosing the mode for you; it was on in my test. To choose it yourself, click Configure, select Custom SSL/TLS and pick the mode. Looking changes nothing; saving changes your Cloudflare setting.
Cloudflare’s 526 page says the error needs Full (strict). So if the overview shows Full (strict), the certificate is the problem: go to step 3. Switching to Full here is the quick fix from the table above, with its risk.
Step 3: Look at the certificate your server sends
▶ On the server (SSH terminal):
echo | openssl s_client -connect 127.0.0.1:443 -servername example.com 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
What it does: connects to the web server on this machine, asks for the certificate for example.com (-servername matters on servers with several sites) and prints who the certificate is for, who issued it, its valid dates and the names it covers. It changes nothing. If it says unknown option -ext (OpenSSL older than 1.1.1), drop -ext subjectAltName.
How to read it: if subject and issuer are the same, as in my lab (both CN = filecafe.site), the certificate is self-signed. If notAfter is in the past, it has expired. If your domain is not in the Subject Alternative Name line, the hostname does not match. An issuer of CloudFlare Origin SSL Certificate Authority is fine for Full (strict).
▶ On the server (SSH terminal):
curl -sS -o /dev/null -w "%{http_code}\n" --resolve example.com:443:127.0.0.1 https://example.com/
What it does: requests your site from the web server on this machine, skipping DNS and Cloudflare, and checks the certificate the way a browser would. It changes nothing. A status code such as 200 or 301 means the certificate passed. If it did not, you see a curl error 60 line followed by 000; in my lab the message was self-signed certificate.
One exception: with a Cloudflare Origin CA certificate, this test also fails with error 60, unable to get local issuer certificate. I saw exactly that on my server, and it is normal, because only Cloudflare trusts that certificate. If the issuer is a public authority such as Let’s Encrypt and you still get that message, the chain is probably incomplete (step 4).
Step 4: Install a certificate Full (strict) accepts
You have two free choices, and both pass Full (strict). A Cloudflare Origin CA certificate works only behind Cloudflare’s proxy: browsers do not trust it, so if you switch the DNS record to DNS only (grey cloud), visitors get a certificate warning. A publicly trusted certificate such as Let’s Encrypt works with or without Cloudflare, and aaPanel can request one for your site. I used the Origin CA certificate in my test.
To create an Origin CA certificate, open SSL/TLS, Origin Server, Create Certificate in Cloudflare. Keep your hostnames (for example example.com and *.example.com), choose how long it should be valid, and create it. Copy the certificate and the private key straight away: Cloudflare’s Origin CA docs say you cannot see the private key again after you leave that screen. My guide to Origin CA certificates covers creating one and installing it on aaPanel.
On aaPanel, open Website, click your site, open SSL, paste the private key and the certificate into their two boxes and save. You do not need to edit any files.
On a standard Nginx install, save the two files on the server and point the site’s port 443 server block at them.
▶ In your site’s Nginx config file, inside the server block that listens on 443, with your own file paths (changes the config):
ssl_certificate /etc/ssl/example.com-origin.pem;
ssl_certificate_key /etc/ssl/example.com-origin.key;
What it does: tells Nginx which certificate and private key to send. Nothing changes until you reload Nginx below.
For Let’s Encrypt on plain Nginx, point ssl_certificate at the full chain file (fullchain.pem), not the single certificate file, so the intermediate certificate is sent too. Then test and reload:
▶ On the server (SSH terminal), standard Nginx only, as root or with sudo in front (changes the running web server):
nginx -t && systemctl reload nginx
What it does: checks the Nginx configuration for errors and, only if the check passes, reloads Nginx so it serves the new certificate. If the test fails, it prints the file and line with the problem and nothing is reloaded. When the certificate is in place, set Cloudflare back to Full (strict): Configure, Custom SSL/TLS, Full (strict).
Step 5: Or keep the self-signed certificate (Custom Origin Trust Store)
Cloudflare’s 526 page offers one more route: upload your self-signed certificate, or the private authority that signed it, to the Custom Origin Trust Store, so Full (strict) trusts it. I did not test this, so I only mention it. For a normal WordPress site, a free Origin CA or Let’s Encrypt certificate is the simpler fix.
Step 6: Check that it is fixed
Run the three requests from step 1 again, with Full (strict) still set. You should see 200 (or a normal redirect) every time. In my lab, with the Origin CA certificate installed, they returned 200 in 0.37, 0.27 and 0.20 seconds. If you still get 526, run step 3 again: the server may still be sending the old certificate.
On shared hosting
On shared hosting you cannot run these commands. Use the panel’s SSL page to install a free certificate for your domain, or ask your host to, and send them the Ray ID and the time of the error. If your host cannot help with errors like this, a small VPS gives you full control; I tested Vultr, Hetzner and DigitalOcean with real numbers.
Error 526 vs 525: certificate or handshake?
Error 525 (SSL handshake failed) means the HTTPS handshake between Cloudflare and your server failed, and it can appear in Full or Full (strict). Error 526 means the handshake got far enough for your server to send its certificate, but Cloudflare rejected that certificate in the Full (strict) check, so it appears only in Full (strict). On the same test server, serving plain HTTP on port 443 gave 525 in 0.23, 0.83 and 0.23 seconds, not 526. That 525 test and its fix are in my error 525 guide.
Does error 526 hurt SEO?
A short 526 is unlikely to do lasting damage. Google’s documentation says 5xx server errors make Googlebot slow down crawling, and that indexed URLs that keep returning server errors are eventually dropped from the index. A certificate problem usually hits every page at once, so fix it the same day.
How to prevent error 526
- Choose the SSL mode yourself. Configure, Custom SSL/TLS, Full (strict). With automatic mode on, Cloudflare picks the mode, and my test zone was in strict without my knowing.
- Track expiry dates. Cloudflare does not send expiration notifications for Origin CA certificates, so note the date when you create one. For Let’s Encrypt, make sure renewal keeps working.
- Cover every proxied hostname. One certificate with example.com and www.example.com (or example.com plus *.example.com) avoids a hostname mismatch on the version you forgot.
- Monitor through Cloudflare. An uptime check on your real domain catches a 526 that a check on the server’s IP would miss.
- Keep the rest of the setup right. My Cloudflare settings for WordPress guide covers which settings to use, including Full (strict).
Error 526 FAQ
How to fix error code 526?
Open SSL/TLS, Overview in Cloudflare. If the mode is Full (strict), install a certificate it accepts on your server: a free Cloudflare Origin CA certificate or a publicly trusted one such as Let’s Encrypt, inside its valid dates, covering your domain and sent with its full chain. Switching to Full stops the error but turns off the certificate check, so use it only for a short time.
What does code 526 mean?
It means Cloudflare could not validate the SSL certificate on the website’s own server while the SSL/TLS mode is Full (strict). Cloudflare’s browser page calls it Invalid SSL certificate.
What is status code 526?
A Cloudflare-specific status code in the 5xx (server error) range, not a standard HTTP status. Cloudflare returns it instead of the page when it rejects the origin server’s certificate.
What does error 526 mean in Roblox?
If the 526 comes from Cloudflare (an Invalid SSL certificate page), it points to a certificate problem on the service’s own servers, not to your device, account or connection. I have not tested Roblox, and an app can use its own error numbers. Wait, check the service’s status page and try again later.
Is error 526 my fault?
Not if you are a visitor. Your browser and Cloudflare are both working; the website’s server has a certificate Cloudflare will not trust. If you own the site, the fix is the certificate on your server or your Cloudflare SSL mode.
Is Full SSL safe instead of Full (strict)?
Full still encrypts traffic between Cloudflare and your server, but it accepts any certificate, so the connection can be intercepted. In my test it turned 526 into 200 without fixing anything. Use it briefly, then install a valid certificate and go back to Full (strict).
Why do I get error 526 when I chose Full?
Check SSL/TLS, Overview. If it says Automatic mode enabled, Cloudflare chooses the mode for you. In my test it showed Full (strict) while I believed the zone was on Full. Choose Custom SSL/TLS under Configure to set the mode yourself.
Do I need a paid SSL certificate to fix error 526?
No. A free Cloudflare Origin CA certificate or a free Let’s Encrypt certificate both pass Full (strict). In my test, the Origin CA certificate gave 200 in Full (strict).
Do browsers trust a Cloudflare Origin certificate?
No. It only works while traffic goes through Cloudflare’s proxy. A direct curl request to my server rejected it with error 60, unable to get local issuer certificate, while requests through Cloudflare in Full (strict) returned 200.
Does Flexible SSL fix error 526?
It makes the error go away because Cloudflare stops using HTTPS to your server, but then nothing is encrypted between Cloudflare and your server, and WordPress sites that force HTTPS often end up in redirect loops. I did not test Flexible. Fix the certificate instead.
