Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 1 of 9

Certificate error

Solved! Go to Solution.

This is a noob problem, but anyway:


Whenever I try to access my github page site, I get a certificate error:


The server uses an invalid security certificate. The certificate is only valid for the following names:, *,, *,, *, Error code: SSL_ERROR_BAD_CERT_DOMAIN


I've setup everything correctly, as far as I know.

8 Replies
Copilot Lvl 2
Message 2 of 9

Re: Certificate error

Github pages available via https only if you use * domain. If you will take a look at repository settings:



and yes, Chrome show warnings about certificate:



I used the hack which explained here: but then you will need a free account at CloudFlare and update your DNS records.

Copilot Lvl 2
Message 3 of 9

Re: Certificate error

I also ran into this problem yesterday, when running a tool that does not use http unless an https request first fails to connect. I was surprised to find that disabling "Enforce HTTPS" didn't actually disable https, and that Pages would still try to send a github certificate. It doesn't seem that there's anything a user can do if they don't need or want https for their site, which seems like a bug.

Message 4 of 9

Re: Certificate error

Hi all! Great questions and conversation here. I have some more info that I think will help.

We respond over both HTTP and HTTPS for all sites. Some users put proxies, like Cloudflare, in front of their site, but this means we can't downgrade from HTTPS to HTTP. This is because HTTPS might work, but we don't know that at our end. If a user (or tool) explicitly requests HTTPS, we'll serve it with whatever cert we have, but only if the user requests it.

Enforcement is specifically about redirecting HTTP to HTTPS. When not enabled, we don't redirect, but still serve HTTPS.

Having said all that, this particular issue isn't really a bug, because to us, the visitor is explicitly asking for HTTPS.

As mentioned above, if you're unable to hard-code HTTP, adding Cloudflare in front of your site can allow you to support HTTPS.

HTTPS for custom domains is one of our most frequent features requests, and I can tell you that it's something we're working on (though I can't specify a timeline for that).

I hope this helps!

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 2
Message 5 of 9

Re: Certificate error

Thanks for explaining!

Copilot Lvl 2
Message 6 of 9

Re: Certificate error

Even though I haven't add Cloudfare or didn't request for https. The custom github page redirects to a https page ( with certificate error). Any help on that?

Message 7 of 9

Re: Certificate error

Hi @sin9yt,

This sounds like something that we might have to get more private account information for in order to troubleshoot. I'd recommend reaching out to our private support at to look into that issue.

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Ground Controller Lvl 1
Message 8 of 9

Re: Certificate error

It seems github pages now has https support more widely (as the warning has been removed from the enforce https option). Is this true? How do we ensure that https is used?

Copilot Lvl 2
Message 9 of 9

Re: Certificate error

The best solution I have found to this is to add the CAA record in this way:

your.domain 120 IN CAA 1 issue ""

www.your.domain 120 IN CAA 1 issue ""


with a 1 and not a 0 (I can't remember why)


On cloudflare, to do so you must export modify the 0 in 1 and import back in cludflare for this to work.