Given a simple Node.js app:
var https = require('https');
var fs = require('fs');
var options = {
key: fs.readFileSync('mykey.pem'),
cert: fs.readFileSync('mycert.pem')
};
https.createServer(options, function (req, res) {
console.log(req.connection.getPeerCertificate());
res.writeHead(200);
res.end("hello world\n");
}).listen(8000);
Results in output to the console with a representation of the certificate, not the original (PEM) format.
Are there other methods available to access the original?