[From] https://segmentfault.com/q/1010000004705326

 

var options = {
    key: fs.readFileSync('../ssl/private.key','utf8'),
    cert: fs.readFileSync('../ssl/certificate.crt','utf8'),
    ca: fs.readFileSync('../ssl/ca_bundle.crt','utf8')
};

http.createServer(app).listen(3000);
https.createServer(options, app).listen(3001);

 

相关文章:

  • 2021-12-14
  • 2021-08-12
  • 2021-10-13
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2021-06-18
  • 2022-01-02
  • 2021-08-04
  • 2021-12-26
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案