const https = require('https');
const fs = require('fs');
const options = {
pfx: fs.readFileSync('证书.pfx'),
passphrase: '证书密码'
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
教程详情:http://nodejs.cn/api/https.html,按照IIS证书就可以了,证书可以淘宝Gworg获取。