Website refuses to connect after installing SSL using Let's encrypt

Keywords: WordPress + NGINX + SSL - AWS - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: 02001002
1648#1648

Description:
Initially tried to use bncert-tool but realized it does not work on NGINX servers.

Therefore, followed the alternative approach mentioned in the link below.

https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/#alternative-approach

Then i used approach A for NGINX .

Then i got an error running this command,
sudo mv /opt/bitnami/nginx/conf/bitnami/certs/server.csr /opt/bitnami/nginx/conf/bitnami/certs/server.csr.old

However, I was able to run the rest of the codes and complete the process. However, once everything is done, tried to restart the server using the command below and it did not work.

sudo /opt/bitnami/ctlscript.sh start

Instead, I was able to find a solution for that in one of your threads and restarted the server.

Now, I cannot access my website as it refused to connect.

You can find bnsupport tool outputs below.

===== Begin of bndiagnostic tool output =====

? Nginx: Found possible issues
? Mariadb: Found possible issues
? Connectivity: Found possible issues
βœ“ Wordpress: No issues found
? Resources: Found possible issues
βœ“ Php: No issues found

[Nginx]

Found recent error or warning messages in the Nginx error log.

2021/06/03 13:53:25 [emerg] 1129#1129: cannot load certificate key
"/opt/bitnami/nginx/conf/bitnami/certs/server.key": BIO_new_file() failed (SSL:
error:02001002:system library:fopen:No such file or
directory:fopen('/opt/bitnami/nginx/conf/bitnami/certs/server.key','r')
error:2006D080:BIO routines:BIO_new_file:no such file)
 2021/06/03 14:04:52 [emerg] 1648#1648: cannot load certificate
"/opt/bitnami/nginx/conf/bitnami/certs/server.crt": BIO_new_file() failed (SSL:
Press [Enter] to continue:


PLEASE HELP.

Hi @heshan,

Can you paste the bnsupport id output?

Regards,
Michiel

I have the same problem.
I can’t restart the services after installing the certificate

===== Begin of bndiagnostic tool output =====

? Nginx: Found possible issues
βœ“ Mariadb: No issues found
? Connectivity: Found possible issues
βœ“ Wordpress: No issues found
βœ“ Resources: No issues found
βœ“ Php: No issues found

[Nginx]

Found recent error or warning messages in the Nginx error log.

2021/06/08 03:47:38 [emerg] 2847#2847: cannot load certificate
"/opt/bitnami/nginx/conf/bitnami/certs/server.crt": BIO_new_file() failed (SSL:
error:02001002:system library:fopen:No such file or
directory:fopen('/opt/bitnami/nginx/conf/bitnami/certs/server.crt','r')
error:2006D080:BIO routines:BIO_new_file:no such file)
 2021/06/08 03:49:53 [emerg] 2973#2973: cannot load certificate
"/opt/bitnami/nginx/conf/bitnami/certs/server.crt": BIO_new_file() failed (SSL:
Press [Enter] to continue:
error:02001002:system library:fopen:No such file or
directory:fopen('/opt/bitnami/nginx/conf/bitnami/certs/server.crt','r')
error:2006D080:BIO routines:BIO_new_file:no such file)
 2021/06/08 04:04:20 [emerg] 3042#3042: cannot load certificate
"/opt/bitnami/nginx/conf/bitnami/certs/server.crt": BIO_new_file() failed (SSL:
error:02001002:system library:fopen:No such file or
directory:fopen('/opt/bitnami/nginx/conf/bitnami/certs/server.crt','r')
error:2006D080:BIO routines:BIO_new_file:no such file)

My code support: **f39d51aa-865e-72fd-048a-943527fc7587**

Help me Please :pray: :pray:

Hi @cris.arellano25,

The server.crt symlink is pointing to a file called DOMAIN.crt:

server.crt -> /opt/bitnami/letsencrypt/certificates/DOMAIN.crt

While it should point to the actual certificate. Can you recreate the symlinks but replacing DOMAIN with the actual domain?

sudo ln -sf /opt/bitnami/letsencrypt/certificates/DOMAIN.key /opt/bitnami/nginx/conf/server.key
sudo ln -sf /opt/bitnami/letsencrypt/certificates/DOMAIN.crt /opt/bitnami/nginx/conf/server.crt

And then restart Nginx:

sudo /opt/bitnami/ctlscript.sh restart nginx

Regards,
Michiel

1 Like

do the above steps and when restarting the nginx service, it threw me error
Failed to restart nginx: Failed to restart nginx

Hi @cris.arellano25,

Can you run the bnsupport tool again so I can check the current configuration?

How to Run the Bitnami Support Tool in a cloud image or virtual machine

Please note that you need to paste the code ID that is shown at the end.

Regards,
Michiel