Hi @prakhar,
It seems that there is something wrong with the certificate files. Let's generate a new self-signed certificate so you can start Apache again and we will help you to generate a new valid certificate later
sudo rm -rf /opt/bitnami/apache2/conf/server.*
sudo openssl genrsa -out /opt/bitnami/apache2/conf/server.key 2048
sudo openssl req -new -key /opt/bitnami/apache2/conf/server.key -out /opt/bitnami/apache2/conf/cert.csr
sudo openssl x509 -in /opt/bitnami/apache2/conf/cert.csr -out /opt/bitnami/apache2/conf/server.crt -req -signkey /opt/bitnami/apache2/conf/server.key -days 365
sudo /opt/bitnami/ctlscript.sh restart apache
One of those commands will request you additional information when running it, just set the values and it will generate the certificate. Can you access Apache now?
In order to generate the Let's encrypt certificate again, please run these commands
sudo /opt/bitnami/ctlscript.sh stop
sudo lego --email="EMAIL-ADDRESS" --domains="DOMAIN" --domains="www.DOMAIN" --path="/etc/lego" run
sudo mv /opt/bitnami/apache2/conf/server.crt /opt/bitnami/apache2/conf/server.crt.old
sudo mv /opt/bitnami/apache2/conf/server.key /opt/bitnami/apache2/conf/server.key.old
sudo mv /opt/bitnami/apache2/conf/server.csr /opt/bitnami/apache2/conf/server.csr.old
sudo ln -sf/etc/lego/certificates/DOMAIN.key /opt/bitnami/apache2/conf/server.key
sudo ln -sf /etc/lego/certificates/DOMAIN.crt /opt/bitnami/apache2/conf/server.crt
sudo chown root:root /opt/bitnami/apache2/conf/server*
sudo chmod 600 /opt/bitnami/apache2/conf/server*
sudo /opt/bitnami/ctlscript.sh start
Please substitute DOMAIN in each of the commands so Apache is configured correctly. If you use DOMAIN in any of those commands, just ran the command again with the proper domain name
https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/
Could you please share with us the output of the following commands again?
sudo ls -la /etc/lego
sudo ls -la /etc/lego/certificates
sudo ls -la /opt/bitnami/apache2/conf/
Thanks