If you are using  AWS LightSail to host your Magento Website, enable HTTPS mode with the help of Let’s Encrypt SSL certificate.

Before making any changes to to AWS Lightsail Magento site enable the SSL. I would strongly recommend to take a snapshot or backup of your server.

We will user certbot client for this purpose.

You need to user putty to get SSH access to your AWS Lightsail server.

Steps are  .1. Download and install putty 2. Get SSH key from AWS 3. Convert the Key for Putty 3. Add the key to the SSH. ( This is another topic -Hopefully you know this already)

Once connected via putty you will get to home folder.

Do “cd ..” to go back to root folder.

Then try /opt/bitnami/letsencrypt/. If there is no folder . Create folder with mkdir letsencrypt.

Download certbot-auto

$ sudo wget https://dl.eff.org/certbot-auto
$ sudo chmod a+x ./certbot-auto

For update and complete install . Do
$ sudo ./certbot-auto

Next step is to Generate the certificate.

$ sudo ./certbot-auto certonly --webroot -w /opt/bitnami/apps/magento/htdocs/ -d www.example.com -d example.com

Replace the domain with your own domain name.

Once completed the certificates files will be created as per the Important Notes section in
/etc/letsencrypt/live/www.domain.com/ and /etc/letsencrypt/live/domain.com/

Now we need to get this certificates mapped to the apache. 

For this either create a symbolic link or copy the cert to apache folder. 

Symbolic link.
$ sudo ln -s /etc/letsencrypt/live/[DOMAIN]/fullchain.pem /opt/bitnami/apache2/conf/server.crt
$ sudo ln -s /etc/letsencrypt/live/[DOMAIN]/privkey.pem /opt/bitnami/apache2/conf/server.key

If there is files already exists error then.

$ mv /opt/bitnami/apache2/conf/server.key /opt/bitnami/apache2/conf/serverkey.old
$ mv /opt/bitnami/apache2/conf/server.crt /opt/bitnami/apache2/conf/servercrt.old

Now restart apache.
$ sudo /opt/bitnami/ctlscript.sh restart apache

check https://www.yourdomain.com and see the new certificate

Adding Free Letsencrypt SSL to your Magento AWS lightsail Server