How do I save certificate files? #31

Closed
by Ghost opened 5 years ago · 0 comments
Ghost commented 5 years ago

So, I need to use nginx as my SSL handler. To do so, I need to save the certificates as files, however, when saving them like this:

await writeFile(`./LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/privkey.pem`, leres.privkey);
await writeFile(`./LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/cert.pem`, `${leres.cert}\r\n${leres.chain}`);

and running them through nginx using the following

listen 443 ssl; 
ssl_certificate ${__dirname}/../../../LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/cert.pem;
ssl_certificate_key ${__dirname}/../../../LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/privkey.pem; 

my browser sees the certificate files, accepts that they are proper certificates but claims that I am using an unknown CA which isn't valid. Anyone have any idea on how to fix this?

So, I need to use nginx as my SSL handler. To do so, I need to save the certificates as files, however, when saving them like this: ```javascript await writeFile(`./LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/privkey.pem`, leres.privkey); await writeFile(`./LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/cert.pem`, `${leres.cert}\r\n${leres.chain}`); ``` and running them through nginx using the following ```javascript listen 443 ssl; ssl_certificate ${__dirname}/../../../LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/cert.pem; ssl_certificate_key ${__dirname}/../../../LetsEncrypt/Certs/${domainDoc.domain.split("https://")[1]}/privkey.pem; ``` my browser sees the certificate files, accepts that they are proper certificates but claims that I am using an unknown CA which isn't valid. Anyone have any idea on how to fix this?
Ghost closed this issue 5 years ago
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.