将中间证书加载到Node.js

时间:2016-05-04 15:25:18

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

我试图让我的中间证书被node.js识别。 我在主服务器的Windows服务器2008R2和IIS 7上  但是我在端口4443上有一个应用程序,它是node.js,需要通过https提供。我有sfloptions中指向的pfx文件,并将其与密码短语一起传递到createserver中。 中间证书已安装到Windows证书库中。 我正在使用这个中间件https://github.com/coolaj86/node-ssl-root-cas

这是我的代码:

    var myssl = require('ssl-root-cas/latest').inject()
.addFile('path-to-app/ssl/gd-g2_iis_intermediates.pem');

…
var ssloptions = {

   pfx: fs.readFileSync('path-to-app/ssl/my.pfx'),
   passphrase: "thecorrectpassword"
};


app.listen = function(){
  //var server = http.createServer(this);
  var server = https.createServer(ssloptions,this);
  return server.listen.apply(server, arguments);
};

当我在SSL检查器上测试网址https://example.com/时,它会将链报告为已完成。当我查看此网址https://example.com:4443/时,我收到了消息

  

所有网络浏览器都不信任该证书。您可能需要安装中间/链证书才能将其链接到受信任的根证书。详细了解此错误。您可以通过遵循服务器平台的GoDaddy证书安装说明来解决此问题。注意关于中级证书的部分。

GoDaddy文档没有帮助。

非常感谢任何和所有帮助。

由于

标记

0 个答案:

没有答案
相关问题