에몽이

nodejs let's Encrypt ssl 인증방식 본문

web/webRTC

nodejs let's Encrypt ssl 인증방식

ian_hodge 2017. 4. 13. 20:59

Node.js

var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('/etc/letsencrypt/live/example.com/privkey.pem'),
  cert: fs.readFileSync('/etc/letsencrypt/live/example.com/cert.pem'),
  ca: fs.readFileSync('/etc/letsencrypt/live/example.com/chain.pem')
};

https.createServer(options, function (req, res) {
  res.writeHead(200);
  res.end("hello world\n");
}).listen(8000);

출처:https://gist.github.com/davestevens/c9e437afbb41c1d5c3ab

Comments