Ved Agarwal
Ved Agarwal

Reputation: 565

Detect TLS Version in Node Express App?

Is it possible to detect the TLS version 1.1 or 1.2 etc in Node Express application.

Upvotes: 4

Views: 3019

Answers (1)

Dario
Dario

Reputation: 4035

If your are using express you can try with:

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

Upvotes: 4

Related Questions