You can configure Magento 2 to use SSL from both the control panel and the SSH console.
It is important to have an SSL certificate purchased and installed in cPanel, then follow the procedure below:
From the Magento 2 administration panel:
Click on Stores -> Configuration
From the General page - select Web
In the Base URLs (Secure) section, select https: //www.domainname.tld/
In the User Secure URLS in Frontend box, select Yes
Click Save Config
Using SSH
Connect to the server using SSH.
Navigate to the location where you installed Magento
cd /home/[user]/[numedomeniu.tld]/html/
Enable SSL for both the administration side and the frontend
php bin/magento setup:store-config:set --use-secure=1 --base-url="https://[numedomeniu.tld]"
Enable SSL only for the control panel part
php bin/magento setup:store-config:set --use-secure-admin=1 --base-url="https://[numedomeniu.tld]"
Additional resources
http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-subcommands-store.html
If you encounter problems in applying the above instructions please contact us. HostX offers the best Magento web hosting service and can assist you in solving your problems.
