Skip to content

Instantly share code, notes, and snippets.

@stolsma
Created October 1, 2011 05:08
Show Gist options
  • Save stolsma/1255625 to your computer and use it in GitHub Desktop.
Save stolsma/1255625 to your computer and use it in GitHub Desktop.
getPeerCertificate example
var https = require('https'),
fs = require('fs');
var options = {
key: fs.readFileSync('./ssl/privatekey.pem'),
cert: fs.readFileSync('./ssl/certificate.pem'),
requestCert: true
};
https.createServer(options, function (req, res) {
res.end(req.connection.getPeerCertificate());
}).listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment