Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 2
Message 21 of 47

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

Here is a short list of some of the popular websites currently broken websites to demonstrate how pevasive this issue is in practice:

 

- https://www.commonmark.org/

- https://www.scikit-learn.org/

- https://www.pytorch.org/

- https://www.selenium.dev/

- https://www.rpm.org/

- https://www.webassembly.org/

- https://www.wkhtmltopdf.org/

- https://www.metaflow.org/

- https://trailofbits.com/

- https://www.microservices.io/

- https://www.semver.org/

- https://www.vue-chartjs.org/

- https://www.flutterowl.com/

...

 

Any update on the timeline to address this issue would be appreciated.

Highlighted
Copilot Lvl 2
Message 22 of 47

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

Finally found a workaround to this today!

 

What I did was

  • In the DNS Editor of my domain (I use GoDaddy) I added a CNAME with www as the host, which points to ourcompany.github.io
  • In the settings on the repository where I used to have salt.dev - I switched it to be www.salt.dev
  • The CNAME file in my repository just contains salt.dev

 

Now it works properly for me.

https://www.salt.dev/

https://salt.dev/

Highlighted
Ground Controller Lvl 2
Message 23 of 47

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"
Highlighted
Ground Controller Lvl 1
Message 24 of 47

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.
Highlighted
Ground Controller Lvl 1
Message 25 of 47

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.

 

Highlighted
Ground Controller Lvl 1
Message 26 of 47

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

Work, thanks!
Lets see again in 3 months otherwise I have to do a toogle again :)

Highlighted
Copilot Lvl 2
Message 27 of 47

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

Same situation:

"example.com" in the github pages settings.
"Enforce HTTPS" in the github pages settings.

 

http:\\example.com - works
https:\\example.com - works, cert good
http:\\www.example.com - works
https:\\www.example.com - cert error

I tried the workaround described by tmarkettos
Does not work in my case.
May be I did something wrong?
Entered "example.com" in the github pages settings. Waited a bit. Changed it back to example.com
tmarkettos -- how long should I wait?

Anyway, Github team, pls fix it, it is clearly a bug. 

Highlighted
Ground Controller Lvl 1
Message 28 of 47

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

I Just had to do the same thing for several sites. I can confirm that it does appear to work.

 

Steps:

1) change www.example.com to example.com & save.

2) change it back to www.example.com & save.

3) re-enable HTTPS enforcement.

4) Wait awhile (30min - 1hr+) and verify that https://example.com redirects to https://www.example.com w/o any certificate errors.

 

NOTE: I took very little time between steps 1 & 2. It seems simply change the configuration is enough.

 

With how simple this work-around is, I'm pretty shocked that github is still having issues with it this many years later...

Highlighted
Copilot Lvl 3
Message 29 of 47

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

Any update on this? Having users meet Chrome's "Your connection is not private" screen when they incude/exclude the www subdomain is a bit of a massive problem.

Highlighted
Ground Controller Lvl 1
Message 30 of 47

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

I'd also like to know if there's any work being done to solve this.