Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 252 forks source link

enable SSL in express server #176

Open manhag opened 5 years ago

manhag commented 5 years ago

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);

  }
AlexWalder commented 4 years ago

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