Manasi Salvi

Troubleshooting why my custom domain did not have SSL support with GitHub

GitHub supports (certain) custom domain names registered with a Domain Name Provider for SSL protection. GitHub recently announced on it’s blog that GitHub Pages now have support for HTTPS. I found that one of my personal projects with a custom domain name was not supported for SSL protection. This led me down a path of troubleshooting what I needed to do to enable this feature.

In GitHub you are required to have CNAME for your custom domain for SSL support. According to GitHub this should allow access to HTTPS however I did not have access to this inspite of using CNAME. After looking into this issue further I came across this article on custom domains. Again, it seemed like I had registered a apex domain correctly with the DNS provider. Just to double check I used the dig command with my custom domain as shown here which in my case showed that my DNS record did not point to GitHub’s server. Meaning, I had to go back to the DNS provider and check if it had been set up correctly. With some investigation here I discovered the nameserver was pointing to a custom DNS for security reasons (details of which cannot be mentioned here for security reasons). This is where things became a bit complicated so to ensure I did not break any of the security settings on the nameserver but to still achieve the result of using SSL - I redirected all requests with the “http” scheme to “https”. This was luckily done through a simple button on the nameserver’s web application in this case.

In conclusion what this mean’t was that I couldn’t change the settings on GitHub but I was able to use SSL support through another hosting nameserver. This has led me to do further research into how web hosting actually works and the automated CI/CD pipeline - which will be for another post in the future.

Deploying my website in Jekyll

For my personal website http://manasi.me I wanted to use a Jekyll theme. I wanted to use a Jekyll theme to get the site up and running quickly and given there’s hundreds to choose from I decided to use a Jekyll theme called Contrast by Niklas Buschmann which can be found here.

I wanted to host my blog on my own custom domain rather than hosting it on the default given by GitHub Pages. Mainly because the url is shorter and sweeter and I get to personalise the domain name. The only downside being I cannot enforce https since GitHub doesn’t allow this for custom domains.

I am not too familiar with Jekyll but I had worked with Jekyll previously and I thought for a simple blog like this I can just get started and work my way through it. I looked up some Jekyll cheatsheets on Github which were quite useful in using the correct markdown syntax which can be found here and here.

I ran into a couple of issues when I decided to push the changes to GitHub and my website did not publish the way I wanted it to. The first was publishing my second blog post - there were no issues with publishing the first blog post but the second one didn’t get published. Initially I thought maybe it just takes a bit of time - wrong. I went back to my code and I didn’t see anything wrong there as I had used the correct syntax, referred to reliable sources for syntax guides. The one place I didn’t look at though was the Jekyll documentation. The issue was that I did not use the correct convention when saving the file to the _posts folder. Instead of using the correct convention 2012-09-12-how-to-write-a-blog.md I just wrote it in the format 2012-09-12.md which Jekyll did not recognise and therefore did not publish.

The second issue was getting the custom domain name working. When I changed the settings in GitHub Pages to publish the site from the custom domain it published in plain HTML. Again, the Jekyll documentation was helpful. All I had to do was modify the _config.yml file in the repository and change the url to the custom domain. Once the changes were successfully pushed to GitHub, the site published perfectly.