Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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