Skip to content

Instantly share code, notes, and snippets.

@dmelechow
Created November 17, 2019 12:28
Show Gist options
  • Select an option

  • Save dmelechow/72748723743bb54a2c4548fd3d9e59bf to your computer and use it in GitHub Desktop.

Select an option

Save dmelechow/72748723743bb54a2c4548fd3d9e59bf to your computer and use it in GitHub Desktop.
nodejs
var https = require('https');
var http = require('http');
var fs = require('fs');
var options = {
key: fs.readFileSync('./localhost.key').toString(),
cert: fs.readFileSync('./localhost.crt').toString(),
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
honorCipherOrder: true,
secureProtocol: 'TLSv1_2_method'
};
https.createServer(options, app).listen(port, () => {
console.log('server is running on port ' + port)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment