如何使用node.js获取SSL证书信息? [英] How to get SSL certificate information using node.js?

查看:1174
本文介绍了如何使用node.js获取SSL证书信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用此帖

现在我的问题是我想要并行执行多个请求。我已经使用node.js做类似的请求NS服务器,等等,所以它自然想起来。

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.

有人可以帮我吗?

作为一个替代选项,有人可以告诉我是否有一种方法使用PHP并行。

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

谢谢!

推荐答案

面对同样问题的每一个人,这里是答案:

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();

这篇关于如何使用node.js获取SSL证书信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆