Skip to content

Instantly share code, notes, and snippets.

@shuson
Created April 15, 2015 10:09
Show Gist options
  • Save shuson/1964cff827e448f247b0 to your computer and use it in GitHub Desktop.
Save shuson/1964cff827e448f247b0 to your computer and use it in GitHub Desktop.
get ssl certificate information by nodejs
var https = require('https');
https.get('https://www.douban.com/', function(res) {
console.log("cert info: ", res.socket.getPeerCertificate());
}).on('error', function(e) {
console.error(e);
});
//that's it, but no Official API shows socket has ''getPeerCertificate'' function
@fukemy
Copy link

fukemy commented Sep 23, 2024

i got error unable to get local issuer certificate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment