jsparrow.uk

How to get an SSL certificate and HTTPS for your website for free (the easy way)
13 August 2017

How to get an SSL certificate and HTTPS for your website for free (the easy way)

Trying to get an SSL certificate to keep the connection between the client and the server secure without paying a ridiculous amount of money yearly is something that can be quite difficult depending on the circumstances. Luckily however, I found an easy way of getting an SSL certificate for free using letsencrypt and another website, www.sslforfree.com. Here I’ll show you exactly how to get an SSL certificate using sslforfree.

First off, you’ll want to head over to www.sslforfree.com and enter the domain name that you wish to get an SSL certificate for. Enter in the domain and click “Create Free SSL Certificate”. It is possible to use the same certificate for multiple sites, so if you wish to have multiple domains or subdomains secured by the same certificate then enter the domains with a space in between each one.

Once you’ve entered your domains, you have to prove that you own them. This is done by uploading files to your hosting server, which are then checked by letsencrypt. If they match, they you’re good to go!

So to do this, click “manual verification”, followed by “manually verify domain”. Download the files that you are given and then open up your FTP client. Within the root folder of your website, create a hidden folder called “.wellknown”. Make sure your FTP client allows viewing hidden folders and files, otherwise you won’t be able to see the folder.

After this, within .wellknown create another folder called “acme-challenge”. Within this folder, you need to put those files/file that you downloaded before. Once this is done, click on the link on the sslforfree page, if you have done it correctly you should see a random string of numbers and letters.

Once this is done, click download SSL certificate. This will generate the SSL certificate for your site. You should end up with something that looks like this (I’ve pixelated mine):

My web hosting is provided by godaddy, so for me the next step was to log into cpanel and find the SSL/TLS option under security. From here, I selected “manage SSL sites” under “Install and Manage SSL for your site (HTTPS)”. From here, I selected my domain from the list and pasted in the content from the SSL certificate into the boxes. Remember to paste ALL of the content, from the first line to the last.

After this, you should have a working HTTPS connection to your site! Try it, put HTTPS:// before your domain name and see if it works.

Assuming it does, there is still one issue. There is nothing stopping someone from accessing the standard HTTP version of your site, instead of the HTTPS secure version. To fix this, you’ll need to create a .htaccess file. First, create an empty file in the root folder of your website, and call it “.htaccess” (don’t forget to add the dot at the beginning). From here, open up the file and paste this:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://DOMAIN-HERE/$1 [R=301,L]

Replace the DOMAIN-HERE with your domain, for example for me it would be jsparrow.uk. now save, and whenever you try to access your site you should be redirected to the HTTPS version!

I hope that this worked for you or you found it helpful. Please note that these SSL certificates expire after 90 days, so you’ll have to generate a new one every 3 months. However, if you sign up for an account with sslforfree then they’ll send you and email reminder.