Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable SSL in express server #176

Open
manhag opened this issue May 5, 2019 · 1 comment
Open

enable SSL in express server #176

manhag opened this issue May 5, 2019 · 1 comment

Comments

@manhag
Copy link

manhag commented May 5, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants