bootbot icon indicating copy to clipboard operation
bootbot copied to clipboard

enable SSL in express server

Open manhag opened this issue 5 years ago • 1 comments

i want to add key and CRT to express server but it is not working my edit is as following

start(port) {
    this._initWebhook();
    this.app.set('port', port || 3000);
    var fs = require('fs');
    var https = require('https');

    var options = { 
      key: fs.readFileSync('crt/server-key.pem'), 
      cert: fs.readFileSync('crt/server-crt.pem'), 
      ca: fs.readFileSync('crt/ca-crt.pem')
  };  
 
  var httpsServer = https.createServer(this.options, this.app);
  
  httpsServer.listen(3000);
 
  }

manhag avatar May 05 '19 10:05 manhag

I found running it through a proxy such as Caddy was easier than getting express to do what I wanted

AlexWalder avatar Jan 20 '20 10:01 AlexWalder