Let's encrypt Certificates are failing nginx service #396

Closed
opened 2026-04-05 20:27:35 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @logixtreeCode on 5/28/2023

CloudPanel version(s) affected

6.0.8

Description

After generating certificate for panel domain and site's domain. Nginx failed up on restart. Logs suggesting following:

pagespeed: rollback gzip, explicit configuration in /etc/nginx/nginx.conf:107
2023/05/28 18:59:45 [emerg] 112397#112397: cannot load certificate "/etc/nginx/ssl-certificates/custom.crt": PEM_read_bio_X509() failed (SSL: error:04800066:PEM routines::bad end line)

How to reproduce

After installing Let's encrypt SSL, try saving vhost settings again.

Possible Solution

After checking the certificate, I found there are two new line characters \n which were not supposed to be there.

image

Additional Context

Vhost is not valid, error message: nginx: [emerg] cannot load certificate "/etc/nginx/ssl-certificates/custom_domain.crt": PEM_read_bio_X509() failed (SSL: error:04800066:PEM routines::bad end line) nginx: configuration file /etc/nginx/nginx.conf test failed

image

*Originally created by @logixtreeCode on 5/28/2023* ### CloudPanel version(s) affected 6.0.8 ### Description After generating certificate for panel domain and site's domain. Nginx failed up on restart. Logs suggesting following: ``` pagespeed: rollback gzip, explicit configuration in /etc/nginx/nginx.conf:107 2023/05/28 18:59:45 [emerg] 112397#112397: cannot load certificate "/etc/nginx/ssl-certificates/custom.crt": PEM_read_bio_X509() failed (SSL: error:04800066:PEM routines::bad end line) ``` ### How to reproduce After installing Let's encrypt SSL, try saving vhost settings again. ### Possible Solution After checking the certificate, I found there are two new line characters \n which were not supposed to be there. ![image](https://github.com/cloudpanel-io/cloudpanel-ce/assets/18518982/11b87f23-f752-449f-a67b-6b73058265d1) ### Additional Context Vhost is not valid, error message: nginx: [emerg] cannot load certificate "/etc/nginx/ssl-certificates/custom_domain.crt": PEM_read_bio_X509() failed (SSL: error:04800066:PEM routines::bad end line) nginx: configuration file /etc/nginx/nginx.conf test failed ![image](https://github.com/cloudpanel-io/cloudpanel-ce/assets/18518982/c039cf18-abfa-453c-a27b-d1adc886063d)
Sign in to join this conversation.