无法为node.js / express.js设置comodo ssl证书

我正在尝试使用express.js框架服务器在node.js上安装comodo ssl证书,但它不工作。 我从comodo得到了4个crt文件。 我正在尝试以下步骤:

var express = require('express'), fs = require("fs"), https = require("https"); var options = { key: fs.readFileSync('/opt/mytestserver.key'), cert: fs.readFileSync('/opt/mytest.crt'), ca: fs.readFileSync("/opt/mytestbundle.crt") }; var server = https.createServer(options, app); 

请帮忙。

在为我自己寻找解决scheme时发现这个问题没有答案。
希望这可以帮助别人 – 我知道这是OP后的一小会儿。

我能够通过使用我的初始私钥和我在电子邮件中获得的Comodo域证书来创build一个文件夹(我将其命名为certs)来获得它的工作。 我没有将zip文件中的其他3个证书复制到certs文件夹中。

 ... var credentials = { key: fs.readFileSync('certs/privatekey.pem'), cert: fs.readFileSync('certs/mydomainkeyfromcomodo.crt'), }; // ============================================================================= // Start the server // ============================================================================= var https = require('https'); var server = https.createServer(credentials, app); server.listen(app.get('port'), function() { console.log('Server up on port ' + app.get('port')); }); 

希望这可以帮助。