Some people seem to have trouble in enabling SSL in Prestashop, especially when they have custom themes. Let’s see how to do it properly, and eventually debug a couple of errors.
Some words about SSL
If you don’t know what SSL is, or have heard about but don’t grasp the concept, here it is: SSL is a cryptographic protocol, that basically secures data sent across pages with a cryptographic key. It’s basically used to secure credit card transactions, and sensible data like login details, or personal information. In Prestashop, the back office login, front office account pages and orders can be secured with SSL by default. Of course, you can secure other pages if you want, but this is beyond the scope of the quick tip.
Get your certificate first!
Before even thinking on implementing SSL in Prestashop, you must buy an SSL Certificate. It doesn’t come for free in any hosting plan I know, and it has to be bought separately for each domain. This means that if you have myshoes.com, and myshoes.net, 2 SSL Certificates will be needed. Most hosting providers also require you to buy an additional dedicated IP address. Let’s see how to buy an SSL Certificate with a popular and affordable hosting: Arvixe.com.
Setting up an SSL Certificate with Arvixe
I’m using Arvixe, but most of the providers offer about the same way to get an SSL certificate. I’ll also assume your already have a domain, without the SSL Certificate.
First, login to your Arvixe account, and navigate to the Support Center. In the knowledgebase section, you’ll find a link for SSL, with any additional information you may need. You can ask the certificate in many ways: using the live chat (just below Knlowledgebase), sending and email at email@example.com, or opening a ticket. The important thing is that you provide the following information:
- Arvixe Username
- Host to make cert for: (usually domain.com or www.domain.com)
- Country (2 letter abbreviation):
- Company Name:
- Company Division:
As they state in the knowledgebase, if you already have your own certificate, they’ll install that for FREE.
As for their pricing, the SSL itself is $25.95/year, plus 2 additional bucks per month for the dedicated IP.
Check that the certificate is working
After some time (usually, a couple of days) you’ll receive confirmation of the successful installation of your certificate. it’s time to test it out. Login to your prestashop admin panel, and navigate to Preferences -> General.. The very first option will allow you to test out your new SSL certificate:
Click on Please click here to use HTTPS protocol before enabling SSL.
If everything works out correctly, after the page refreshes your address bar will have https:// at the beginning, with a padlock right in front:
If, for some reason, you can’t access the page (Internal Server Error 500, 404 not found, 102 (net::ERR_CONNECTION_REFUSED) or anything else) your SSL certificate is not seup correctly. If this happens contact your hosting immediately, since you can’t do anything about it.
Else, if you can display the new page, set Enable SSL to yes, and save.
At this point, your content should be secured. Access an account page, and try placing an order in your Prestashop front-office. You should get the https:// prefix for the url.
But this might not happen at times, even though the secure link was okay for your admin page. If you get some new 404, 500, or 102 errors, the only option is to contact the hosting. Let them also know if you use Pretty URLs, as this might conflict at times. A bunch of other issues can be solved anyway.
The page at http://mysitesname.com ran insecure content from http://anotherpage.com/file.ext
If your theme has a slider, you will need to change the prifix for those.
I can’t access my site (back nor front office) anymore!
Your server’s SSL settings might be wrong. In this case, you must force Prestashop not to use SSL. Login to your phpMyAdmin (or any other database manager). Access the configuration table, and locate PS_SSL_ENABLED. It should be set to 1, crush it to zero. This way, you’ll be able to access your site again, but of course you’ll have no SSL. Be sure you further investigate the issue, before trying to turn it on again!