How do I save certificate files? #31

已关闭
由 Ghost 于 2019-02-03 13:12:47 +00:00 打开 · 0 评论

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?
Ghost2019-02-03 13:39:57 +00:00 关闭此工单
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
1 名参与者
通知
到期时间
到期日期无效或超出范围。请使用 'yyyy-mm-dd' 格式。

未设置到期时间。

依赖工单

没有设置依赖项。

参考:coolaj86/greenlock.js-ARCHIVED#31
没有提供说明。