For Dummies: How to Set Up an SSL Certificate in OpenCart

This article will get you acquainted with the benefits of SSL (Secure Sockets Layer). You will also learn how to set up SSL for your OpenCart store. Let’s go! 

Important:

The modification in config.php is compatible with OpenCart 3.x.

Also Read: OpenCart SSL: How to Load All Pages with HTTPS

What is SSL and why your website needs it?

When you visit a web page in your favorite web browser, an interesting process happens “under the hood”. Here is what it looks like in a nutshell. Your browser first connects to a web server and “asks” it to send some data. The web server responds and the data is transferred to your browser.

Depending on the kind of data which needs to be transferred, the browser and server follow a number of “rules”. We will call these rules a “protocol”. When you access a webpage, in most cases this is done via the HTTP (Hypertext Transfer Protocol) protocol. Almost all of the websites you visit are served via HTTP.

The good news is HTTP works great and it is now a worldwide standard. The bad news is that it is not secure. In other words, all of the data which is transferred between your web browser and the server is in a sense public, and it can be viewed by a third party without much effort.

You can guess what this means when your customers start entering their credit card details, usernames, emails, passwords, etc. into your HTTP-based website. Since this data is not properly protected, it can easily fall into the wrong hands. This is why it is important to secure your customers’ sensitive information on as many levels as possible.

SSL (Secure Sockets Layer) is a cryptographic protocol, which is used to add an extra level of security to your HTTP requests. The resulting protocol is called HTTPS (HTTP over SSL). It does the same thing as HTTP, but with the added benefit that the transferred data is encrypted and it can be read only by the browser and the server (kind of like the Enigma machine the Nazis used in World War II).

If you are running a website which handles sensitive data (like an OpenCart e-commerce store), HTTPS is a must-have. Read on to see how to configure it.

Setting up SSL on OpenCart

Step 0: (Preparation) Purchasing a certificate

Before you can setup your SSL, you need to purchase an SSL certificate first. Contact your web hosting provider and ask them about this. Your SSL certificate must be installed on the hosting account on which you are running your OpenCart website.

Step 1: Configuring OpenCart

Fortunately, OpenCart have given you a very easy way to enable SSL. Just login to your admin panel and navigate to the following page: Admin > System > Settings > [Edit] > Server

Now find the setting “Use SSL” and set it to “Yes”. Click the “Save” button on the top right.

Step 2: Modifying the config.php files

We are almost done. What is left is to make sure that your OpenCart configuration files have appropriate values.

Using your favorite FTP client, download the file /config.php which is located in the root folder of your OpenCart website. Open it for editing.

Notice that there is a line which looks something like this:

define('HTTPS_SERVER', '{your-website-domain}');

Make sure that {your-website-domain} starts with https.

Save the file and upload it to your server.

Now download the file /admin/config.php and open it for editing.

Notice that there are 2 lines which look something like this:

define('HTTPS_SERVER', '{your-website-domain}');
define('HTTPS_CATALOG', '{your-website-domain}');

Make sure that {your-website-domain} starts with https.

Now save the file and upload it to your server. Great job!

Step 3: Testing

Open up your website by typing https://{your-website} in your favorite web browser.

If everything is set up correctly, you will see a green padlock in your URL. It should look like this:

In conclusion

Congratulations! This was not so hard, was it? If you have any questions, let us know in the comments below.

Join 11,000+ subscribers receiving actionable E-commerce advice

* Unsubscribe any time

Trending blogs

comments powered by Disqus