Pass requestCert to https.createServer

This commit is contained in:
Maciej Małecki 2014-03-15 02:54:16 +01:00
parent eb621217f9
commit 7e9f540194

View file

@ -57,8 +57,14 @@ config.load(function(err, conf) {
var testkeys = path.join(__dirname, '..', 'testkeys');
var privateKey = fs.readFileSync(path.join(testkeys, 'privatekey.pem'));
var certificate = fs.readFileSync(path.join(testkeys, 'certificate.pem'));
var credentials = {key: privateKey, cert: certificate};
https.createServer(credentials, app).listen(port, function () {
var options = {
key: privateKey,
cert: certificate,
requestCert: true
};
https.createServer(options, app).listen(port, function () {
console.log('Express server listening on port ' + port + ' (https)');
});
}