【问题标题】:SSL certificates for a Node.Js / Express app in Webfaction?Webfaction 中 Node.Js / Express 应用程序的 SSL 证书?
【发布时间】:2015-04-10 06:31:18
【问题描述】:

我在 webfaction 服务器上运行我的 express / node.js 应用程序并想安装我从 Comodo 收到的 SSL 证书...我通常在我的本地服务器上自行生成两个文件 - 私有和公共 - 但是对于我的网站,我生成了外部网站,他们发给我 4

Root CA Certificate - AddTrustExternalCARoot.crt
Intermediate CA Certificate - COMODORSAAddTrustCA.crt
Intermediate CA Certificate - COMODORSADomainValidationSecureServerCA.crt
Your EssentialSSL Certificate - website_com.crt

如果我需要在 app.js 中而不是 ???? 中写入,你知道我应该如何处理这些内容吗?

var options = {
    key: fs.readFileSync(????)
    cert: fs.readFileSync(????)
     ca: fs.readFileSync(????)
 };

谢谢!

PS 我以为你必须将一些文件cat 放在一起,但你认为上面的哪些?

【问题讨论】:

    标签: node.js ssl express ssl-certificate webfaction


    【解决方案1】:

    您的options 需要如下所示:

    var options = {
        key: fs.readFileSync('/path/to/yourprivatekey.pem'),
        cert: fs.readFileSync('/path/to/website_com.crt'),
        ca: [
            fs.readFileSync('/path/to/COMODORSAAddTrustCA.crt'),
            fs.readFileSync('/path/to/COMODORSADomainValidationSecureServerCA.crt')
        ]
    };
    

    您不需要将AddTrustExternalCARoot.crt 添加到您的 ca 列表中,因为所有浏览器都应该有根目录。

    类似问题:How to setup EV Certificate with nodejs server

    【讨论】:

    • 这没有回答最初的问题,如何获取 PEM 文件?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-07
    • 2020-10-08
    • 2017-03-05
    • 1970-01-01
    • 2019-01-02
    • 1970-01-01
    相关资源
    最近更新 更多