Created
April 15, 2015 10:09
-
-
Save shuson/1964cff827e448f247b0 to your computer and use it in GitHub Desktop.
get ssl certificate information by nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i got error
unable to get local issuer certificate