luxame19 attempted to replace Let’s Encrypt with a purchased SSL certificate by modifying app.yml and placing files in /var/discourse/shared/standalone/ssl/, but encountered repeated nginx errors indicating ssl.crt could not be found. Despite confirming the files existed, the issue persisted until luxame19 realized the file was named ssl.cer instead of ssl.crt — nginx expects .crt extension. After renaming the certificate file to match the expected format, the SSL configuration succeeded. JimPas initially suspected a path mismatch between Docker volume and host paths, but luxame19 clarified the paths were correctly mapped via Docker volume mounts; the real issue was the file extension. pfaffman had earlier pointed to documentation on custom SSL setup, which luxame19 had reviewed but overlooked the filename requirement. JimPas acknowledged the oversight and congratulated luxame19 on resolving the issue. The root cause was using .cer instead of .crt, not path or permission problems.
I try to reconfig about ssl certificate, want to disable letsencrypt free certificate.
Because I have a purchase certificate, I found some operations through Google.
Modify app.yml directly and confirm key & cer in the /var/discourse/shared/standalone/ssl/
and file name are consistent with config file, then rebuild I get the result is failed still use letsencrypt cer
nginx have some error log :
2021/09/25 16:37:26 [emerg] 48#48: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:27 [emerg] 78#78: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:28 [emerg] 80#80: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:29 [emerg] 82#82: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:30 [emerg] 95#95: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:31 [emerg] 104#104: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:32 [emerg] 106#106: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Thanks for your reply.
For the information you provided, I already have areference and experiment.
But result is failed, nginx service is can’t read file.
The error message is the description above :
2021/09/25 16:37:26 [emerg] 48#48: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:27 [emerg] 78#78: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:28 [emerg] 80#80: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:29 [emerg] 82#82: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:30 [emerg] 95#95: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:31 [emerg] 104#104: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
2021/09/25 16:37:32 [emerg] 106#106: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Something that stood out in your first couple of posts was
cannot load certificate "/shared/ssl/ssl.crt"
and
Have confirm file in the directory
root@discourse-test:/var/discourse/shared/standalone/ssl# ls -al ssl.*
Notice the difference after /shared/ part of the paths. Nginx was expecting the ssl.crt file to be in the shared/ssl/ folder. You found it in shared/standalone/. The file wasn’t in the path where nginx was looking for it.
seems not match, but in fact is same.
the first problem, I was resolve.
root case for me is I didn’t notice certificate format.
config is settings crt format, but I always use cer format file so nginx not success read certificate file.