Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 2
Message 11 of 15

Re: Does GitHub Pages Support HTTPS for www and @ subdomains?

I'm also a little disapointed this is not supported properly. 

Ground Controller Lvl 2
Message 12 of 15

Re: Does GitHub Pages Support HTTPS for www and @ subdomains?

I will be a +1 on that request.

Just bought a .dev domain and was planning on keep it on github as a cv page, but since it needs an SSL cert (.dev rules) now I can't access it from the www subdomain. Not that I actively use it or share the url with it, but it's good to have the option. Right now the visitor will receive a cert error.

I understand not generating * certs to avoid abuse, but a www is pretty default and should be generated together with the apex domain when the repository is configured to a apex, since it's the same thing.

Ground Controller Lvl 2
Message 13 of 15

Re: Does GitHub Pages Support HTTPS for www and @ subdomains?

Until this gets implemented, you can use Cloudflare to serve certificates for your other subdomains, which I write about here: https://www.linuxguideandhints.com/fedora/git.html#setting-up-cloudflare-and-github-pages In the example I used, you would have a CNAME for the www subdomain that points to the FQDN (example.com, or your-username.github.io) with DNS/HTTP Proxy enabled. For the rest of the A records, set it to DNS only. Finally, create two Cloudflare page rules: always use HTTPS and 301 redirect from no-www to www. The example also assumes that you use "www.example.com" as your Github custom domain. Once you set these settings up, you may need to remove and re-add your custom domain so that Github can see the new DNS settings. If you did everything correctly, verify via curl that you see a Github-issued certificate for "example.com" and a Cloudflare-issued certificate for "www.example.com"
Ground Controller Lvl 1
Message 14 of 15

Re: Does GitHub Pages Support HTTPS for www and @ subdomains?

I'm like 90% of the way there. I have http://example.com and https://example and http://www.example.com all redirecting and loading properly with CloudFlare + GitHub Pages. But I cannot get https://www.example.com to redirect, I still get an `SSL_ERROR_BAD_CERT_DOMAIN`. My setup is: CNAME (flattened) example.com user.github.io CNAME www.example.com example.com GitHub Pages Enforce HTTPS is off Clearly www.example.com is redirecting to example.com which then redirects to https; but a direct https connection to www does not work. Has anyone gotten this to work? I might just ditch GitHub pages and host some other way instead, but I really wanted to teardown my (pointless) VM.
Ground Controller Lvl 1
Message 15 of 15

Re: Does GitHub Pages Support HTTPS for www and @ subdomains?

I think I've managed to make this work by accident.

 

We had:

example.com in the github pages settings.

@ on example.com domain pointing to github web servers

www CNAME @

 

Status was

http:\\example.com - works

https:\\example.com - works, cert good

http:\\www.example.com - works

https:\\www.example.com - cert error

 

For an experiment, I went into the github pages settings and set the config to be www.example.com.

My experiment didn't work, so I flipped it back.

 

But now https:\\www.example.com works, and https:\\example.com does too.  SSLLabs is happy with both certificates (which are from Let's Encrypt).

 

It may be that flipping the setting to www caused a new certificate to be generated.  Time will tell whether this cert gets renewed at its 3 month expiry time, or whether github forgets about it.  Anyway, it seems to work for now.