Skip to content

Instantly share code, notes, and snippets.

@edwinschaap
Last active May 25, 2016 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwinschaap/9fed02bfa72d29021d7f6b4e93b5650b to your computer and use it in GitHub Desktop.
Save edwinschaap/9fed02bfa72d29021d7f6b4e93b5650b to your computer and use it in GitHub Desktop.
const fs = require('fs');
const https = require('https');
const options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
https.createServer(options, (req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(443);
ca: fs.readFileSync('chain.pem')
https.createServer(options, (req, res) => {
res.writeHead(200, {
"Strict-Transport-Security": "max-age=31536000"
});
res.end('hello world\n');
}).listen(443);
secureProtocol: "TLSv1_2_method"
ecdhCurve: 'secp384r1'
ciphers: "HIGH:!aNULL:!MD5:!3DES:!CAMELLIA:!AES128"
const fs = require('fs');
const https = require('https');
const options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem'),
ca: fs.readFileSync('chain.pem'),
secureProtocol: "TLSv1_2_method",
ecdhCurve: 'secp384r1',
ciphers: "HIGH:!aNULL:!MD5:!3DES:!CAMELLIA:!AES128"
};
https.createServer(options, (req, res) => {
res.writeHead(200, {
"Strict-Transport-Security": "max-age=31536000"
});
res.end('hello world\n');
}).listen(443);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment