CNAME Flattening and Full (Strict) SSL causes "Invalid SSL Certificate / Error 526)


I’ve recently switched my website’s SSL setting from “Full” to “Full Strict”. However, I noticed that the CNAME Flattening no longer works and instead I get thrown the “Invalid SSL Certificate” error.

Is there any reason as to why this occurs?

Ray ID: 496dfd0fed33996d

1 Like

That is most likely not a CNAME issue but by switching to strict (which generally was a good idea) Cloudflare now requires a valid certificate from your server, which you apparently haven’t got configured though.


Thanks for the reply, but currently, I’m using Github Pages, which uses a valid Let’s Encrypt SSL certificate.

Furthermore, this error only occurs when visiting the website via the root domain (e.g: instead of the ‘www’ domain (e.g:

The latter works fine even with SSL (Strict) enabled. But the non-www url does not work.

1 Like

In that case your certificate might be issued only for www and not the naked domain. If you feel comfortable enough revealing the origin IP, please do so. I presume your origin IP address does not end in 21 any longer, right?

1 Like

Is the origin IP the IP address of the server serving the website?

If so, Github Pages (which is hosting the site) is “linked” via a CNAME record; Hence, there’s no definite origin IP to my knowledge.

Please correct me if I’m wrong

1 Like

Yes, it is. Can you post the CNAME target, the Github URL?

1 Like

Sure, it’s:

1 Like

Ok, I’ve quickly checked my Github Pages settings and found that Enforce HTTPS is disabled.

But this should only prevent HTTPS enforcement, not HTTPS all together?

1 Like

It appears there is no certificate at all configured at Github. Are you sure you configured www and the naked domain identically? Can you post a screenshot?

Also, ensure you did configure the domain and the certificate correctly at Github.

1 Like

So, these are the DNS records:

Type: CNAME (CNAME Flattening)

Name: www

I’ve followed the instructions here to configure Github Pages:

I’ve made sure that the “CNAME” file was part of the Repo:

I’m not too sure which screenshot you’re asking for, is the DNS config on Cloudflare? If so, I’ve attached a snippet below:

1 Like

It seems unusual that “www” would work but not the root domain. Could that possibly be due to caching at the CDN?

1 Like

It appears that Github does not have any certificate configured for your domain. Can you double check that? The fact that www does load is a bit strange though, could it be you have a page rule in place?

try to put your flat cname not to but to instead. maybe that helps.

maybe the CNAME name gets used by CF for cert checking or whatever. one would need to test how they actually check it.

Not too sure how to check the cert given by Github.

I’ve checked my Page Rules, there doesn’t seem to be anything that may cause this issue:

This works! Now the root domain is redirecting to “www” properly.

Not too sure why it works, but hey, at least it works ¯_(ツ)_/¯

well I checked and for the I only found Cloudflare certs so it looks like github cant get a cert for the domain (fairly obvious because the IP goes to Cloudflare and with strict ssl Cloudflare will block any attempt for classic HTTP validation).

with this my theory that CF checks for the name in the CNAME record seems as good as proved.

This topic was automatically closed after 30 days. New replies are no longer allowed.