SSL-on-Github-Pages

Installing SSL on a Github/Gitlab pages static webpage

February 6, 2019, 12:37 PM

Github offers a student education pack, and within that pack also offers 1 free year’s registration on a customized .me TLD alongside a free year of SSL certification.
Sounds great right?
The problem is, Github is not a web hosting platform and only hosts static web pages at a bare minimum capacity, which means theres no real way to use that SSL certification if you’re using Github hosting.

You’re going to have to rely on some other service to provide an SSL redirect for you, which namecheap doesn’t provide.

One such service is Cloudflare, which lets you register a single website for free, which will provide a SSL activated nameserver for your domain, which means for a browser to connect your websites name to an IP address, It’ll ask Cloudflare first.

  1. Register an account for Cloudflare here
  2. Put your .me or .github.io link in the next box
    Add your site here
  3. Let CloudFlare scan current DNS records associated with the domain name, and confirm if they look correct (Look at your Namecheap panel to confirm)

  4. Click the free plan, and continue once you see the new records it will apply

  5. CloudFlare will then give you 2 nameservers that you’ll need to apply to your registrar (Namecheap in this case) so name resolution requests will go through CloudFlare services instead
    Your actual nameserver names may be different

  6. Now, pop over to your Namecheap control panel Advanced DNS section

  7. Now, replace every CNAME and A record currenty in (but leave MX alone) with this:

    • A record for @ pointing to 185.199.108.153
    • A record for @ pointing to 185.199.109.153
    • A record for @ pointing to 185.199.110.153
    • A record for @ pointing to 185.199.111.153
    • CNAME record for www pointing to your username.github.io or username.me domain
  8. Save your progress, and head on over to the Nameservers section in your control panel

  9. Choose Custom DNS, and enter the 2 CloudFlare nameservers that were given to you earlier

  10. After this, you should be all done! Nameserver updates take around an hour, but eventually you’ll be able to access your .me domain with SSL enabled