Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get SSL certificate information using node.js?

I've built a PHP version of this using the answer from this post.

Now my problem is that I want to do multiple requests in parallel. I'm already using node.js to do similar requests for NS servers, etc, so it naturally came to mind.

Can somebody help me with that?

As an alternative option, can somebody tell me if there's a way to make it in parallel using only PHP.

Thanks!

like image 709
Salmon Avatar asked Nov 28 '12 01:11

Salmon


1 Answers

For everybody who's facing the same problem, here's the answer:

var https = require('https');
var options = {
    host: 'google.com',
    port: 443,
    method: 'GET'
};

var req = https.request(options, function(res) {
    console.log(res.connection.getPeerCertificate());
});

req.end();
like image 89
Salmon Avatar answered Oct 26 '22 22:10

Salmon