【发布时间】:2023-03-03 23:32:02
【问题描述】:
我有一个 .pfx 格式的证书,当我使用以下代码并使用 ssl 检查检查 ssl 时,我得到中间证书丢失错误。
if(process.env.NODE_ENV === "production") {
var credentials = {
pfx: fs.readFileSync('C:/self/certificate/testname.com.pfx'),
passphrase: "ffffff!"
};
this.app.server = https.createServer(credentials, this.app);
this.app.server.timeout = 600000;
this.init();
const httpServer = http.createServer((req, res) => {
res.writeHead(301, {Location: `https://${req.headers.host}${req.url}`});
res.end();
});
httpServer.listen(80);
} else {
this.app.server = http.createServer(this.app);
this.init();
}
请告诉我如何使用它。我已经看过一些帖子,比如sample
但找不到可以帮助您安装 .pfx 类型证书的东西。 帮助赞赏。 -AJ
【问题讨论】: