Sunday, 9 April 2017

nodejs and SSL: how to specify the SSL in http.createServer creation?

I have found that snippet that works fine:

var ssl = {
    key:  fs.readFileSync('/etc/letsencrypt/live/example.com/privkey.pem'),
    cert: fs.readFileSync('/etc/letsencrypt/live/example.com/cert.pem')
};
var httpsServer = https.createServer(ssl).listen(port);

However my site uses that server construction:

var server = http.createServer(httpRequestsHandler).listen(_port_, function() {
    process.setgid('www-data');
    process.setuid('user1');
});

Question: how/where do I specify the ssl in this case ?



via yarek

No comments:

Post a Comment