在Node Express App中检测TLS版本?

时间:2016-11-30 09:38:04

标签: javascript node.js express ssl

是否可以在Node Express应用程序中检测TLS版本1.1或1.2等。

1 个答案:

答案 0 :(得分:1)

如果您使用的是express,可以尝试使用:

app.get('/', (req, res, next) => {
  if (req.protocol === 'https')
    console.log(req.connection.getProtocol());
  else
    console.log('Not SSL');
});