RedBird.js 和 Node.js 的 SSL 证书,一台服务器上有两个域

SSL certificates with RedBird.js and Node.js with two domains on one server

坏消息“免费 SSL 加入 ZeroSSL”。因为他们的消息我更新了我的证书并且 TLS 停止工作。过去工作正常。

我相信免费证书现在来自 AutoSSL。希望。

对于新证书,我从 https://www.sslshopper.com/ssl-checker.html and this error "TLS Certificate is not trusted" from https://www.digicert.com/help.

收到错误消息“您可能需要将 Intermediate/chain 证书安装到 link 受信任的根证书”

浏览器足够智能,可以掩盖问题,但我的 Android 应用程序使用了 API,它停止工作了。

自从 ZeroSSL 参与以来,还有其他人遇到 TLS 问题吗?

我在 nodejs 上使用 redbirdjs 这很棒,因为它非常简单(两个域,同一台服务器),但零提供我的设置没有安装说明。 (我的域名流量很小,所以使用最快的网络服务器等不是问题)。

零在一个证书选项中删除了 2 个域(谢谢)所以我更新的脚本如下所示:


const { constants } = require('crypto');

var redbird = new require('redbird')({ port: 8080, ssl: { port: 443 }});

redbird.register('domain1.com', 'http://127.0.0.1:9443', {
    ssl: {
        key: 'ssl/domain1/private.key',
        cert: 'ssl/domain1/certificate.crt',
        ca: 'ssl/domain1/ca_bundle.crt',
        secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
    }
});

redbird.register('domain2.com', 'http://127.0.0.1:3003', {
    ssl: {
        key: 'ssl/domain2/private.key',
        cert: 'ssl/domain2/certificate.crt',
        ca: 'ssl/domain2/ca_bundle.crt',
        secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
    }
});

除了分隔域 ssl 配置外,它与以前使用 SSLForFree 的配置相同。

我在某处读到“免费”SSL CA 不一定提供“完整链”。

有人知道如何在 redbirdjs 和 nodejs 上使用 ZeroSSL 使 TLS 再次工作吗?

好吧,我成功了。我使用了 https://whatsmychaincert.com,我认为它只是将几个文件连接在一起。无论哪种方式,对于红鸟粉丝(像我一样),这里是同一服务器上多个域的脚本。

// https://github.com/OptimalBits/redbird
// https://whatsmychaincert.com/
// 9443 is where domain1 server runs locally
// 3003 is where domain2 server runs locally

const { constants } = require('crypto');

var redbird = new require('redbird')({ port: 8080, ssl: { port: 443 }});

redbird.register('domain1.com', 'http://127.0.0.1:9443', {
    ssl: {
        port: 9443,
        key: 'ssl/domain1/private.key',
        cert: 'ssl/domain1/domain1.chained.crt',  // used whatsmychaincert.com to generate ('enter hostname', no need to include root)
        secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
    }
});

redbird.register('domain2.net', 'http://127.0.0.1:3003', {
    ssl: {
        port: 3003,
        key: 'ssl/domain2/private.key',
        cert: 'ssl/domain2/domain2.chained.crt',
        secureOptions: constants.SSL_OP_NO_TLSv1 | constants.SSL_OP_NO_TLSv1_1,
    }
});

从 ZeroSSL 下载的 3 个文件中,whatsmychaincert.com 将 certificate.crt 和 ca_bundle.crt(按此顺序)放入一个名为 domain.chained.crt 的文件中(见上面的脚本)。