How to configure the SSL certificate in Magento 2January 29, 2021 - ”Tempo 4 ”minutes” Reading Time: 4 minutes
There are many factors that matter when it comes to running an ecommerce store, which should be considered in the early stages of a business. One of them is to provide your users with a secure platform where they don’t have to worry about their privacy. Using SSL certificates to secure your online store has become standard practice in the online business sphere.
What is SSL?
The SSL – Secure Socket Layer certificate is used to secure a website, as it establishes an encrypted connection between the web server and a browser. The biggest advantage of SSL is that the data between encrypted links always remains private. In simple terms, adding the SSL certificate to the store means that you are protecting the user’s private information such as login credentials, credit card information and other sensitive data.
How to configure the SSL certificate in Magento 2
Magento is one of the most powerful and customizable e-commerce platforms. To add the Magento SSL certificate, you will need to purchase it first. Some hosting providers even offer it for free. There are two main steps you need to follow:
- Install the SSL certificate
- Enable the SSL certificate
Let’s see them both together.
Install the SSL certificate
Here we will see how to install Magento SSL on a shared hosting server
Go to the cPanel and click on SSL / TLS in the Security section:
This will redirect you to the SSL / TLS page. You need to click Generate, View, Upload or Delete SSL Certificates:
You will see Let’s Encrypt SSL already installed in the Certificates on Server list . However, if not, you can contact their customer service and they will install it. When Let’s Encrypt is enabled, the SSL certificate renewal process is done automatically. According to their process, Let’s Encrypt SSL will renew itself every 90 days. Now to add your purchased SSL certificate you need to follow a few steps. First go back to the SSL / TLS page and click on Private Keys :
Here generate a private key for the SSL certificate:
Now go to Certificate Signing Requests (CSR):
Here you have to enter the details to create a CSR file which you have to send to the SSL provider. In return, you will get yourdomain.crt (certificate code) and yourdomain.ca (Chain File).
Now go to Certificates (CRT):
Here you need to upload the certificate, paste the certificate body or just upload the .crt file you received from your SSL provider:
Now, finally, go to Install and manage SSL for your site.
Select the domain and you will have the option to automatically fill in the required details or you can also add them manually which you got from the SSL provider:
How to enable SSL in Magento
Enable SSL in Magento 2
To enable Magento 2 SSL, you need to go to Stores → Setup from your store’s admin panel:
Click on Web:
Open the base URL section (safe) and update the fields in the same way as in Magento 1.x:
Now select Yes for Use Secure URLs on Storefront and Use Secure URLs in the Admin fields:
Then save the configuration
Enable SSL in Magento 1
Open the admin panel of your Magento store and then go to System → Configuration:
Click now on Web , in the General section
Open the Security section . First, update the base URL field by changing http to https . Then select Yes for Use secure URLs in the frontend and Use secure URLs in the Admin fields:
Use Protected URLs on Showcase : If you select Yes , all showcase pages will open with https.
Use secure URLs in admin : If you select Yes , your store admin panel will open with https.
Now click on the Save Configuration button