Adding SSL to Your Site (Free!)
Tags: hosting, domain, github, ssl
Published: 2019-06-09 04:36:20

---
title: Adding SSL to Your Site (Free!)
published: true
description: Learn how to add free SSL to your website or GitHub Pages domain!
tags: Hosting, Domain, Github, SSL
cover_image: https://i1.wp.com/rightfrombasics.com/wp-content/uploads/2018/11/marcos-mayer-735961-unsplash.jpg
canonical_url: https://rightfrombasics.com/posts/adding-ssl/
series: Hosting
---

![SSL Error Message](https://imgur.com/ReIvK0H.png)

Seen the error image before?

This happens when you visit my personal website, [harishv.me](https://harishv.me), with a `www` in front. This redirects to [https://harishv.me](https://harishv.me) and all you will see is this `ERR_SSL_PROTOCOL_ERROR` as the site is unable to provide a secure connection. 

If you are using a normal GitHub Pages site, which means it has a domain that has `.github.io`, you can simply go to the GitHub repository you are using, click settings, go all the way down till you see `Enforce HTTPS`. Clicking this will mean that your site will always be served over HTTPS.

When researching free SSL options to add onto my website, I found that you can actually use [Cloudflare’s](https://www.cloudflare.com/) name servers under their free plan to obtain a SSL certificate for your website.

Simply,

1. Create a [Cloudflare](https://www.cloudflare.com/) account
2. Allow Cloudflare to scan your website records
3. Check and verify that the automatically generated records by Cloudflare matches with those on your registrar’s page (in my case, this is [Namecheap.com](http://namecheap.com/))
4. Cloudflare will now give you 2 nameservers to add into your account
5. Login to Namecheap
6. Click on Domains List
7. Select the domain you want to add SSL for and click on `Manage` at the right side
8. Under nameservers, copy and paste the 2 nameservers Cloudflare gave you
9. Once done, on Cloudflare’s Overview tab, click on `Recheck Nameservers`

Cloudflare also offers up to three page rules in the free plan. With this, we can always enforce a `https on our website. To do that,

1. Click on the Page Rule tab at the top in Cloudflare
2. Enter this: `http://*<your-domain-name>.com/*`
3. Add the settings to be `Always Use HTTPS`
4. Click on `Save and Deploy`

The asterisks are like wildcard patterns which means any URLs entered in that format will be enforced to utilise HTTPS connection. For example, [www.harishv.me](www.harishv.me) or [http://harishv.me/blog](http://harishv.me/blog) will all now be enforced with HTTPS.

That’s all folks. Get your free SSL certificate with Cloudflare now! 

P.S. If you’re wondering why is HTTPS that big of a deal, wait a few days for my next article on HTTPS - What’s the Big Deal?.

----

### Looking for Hosting?
- If you want the best Wordpress hosting, I highly recommend [Bluehost](https://www.bluehost.com/track/harishv/). Get a great discount when you [apply through this link](https://www.bluehost.com/track/harishv/).
- Also, get a massive discount with [Hostinger](https://www.hostg.xyz/aff_c?offer_id=6&aff_id=2883) when you [apply through this link](https://www.hostg.xyz/aff_c?offer_id=6&aff_id=2883).

Both services offer great uptime and customer service. Oh did I mention - you get a free domain name with both Bluehost and Hostinger!