(req)
| 37 | |
| 38 | // Tries to obtain a client certificate retrieved through the TLS handshake |
| 39 | function getCertificateViaTLS (req) { |
| 40 | const certificate = req.connection.getPeerCertificate && |
| 41 | req.connection.getPeerCertificate() |
| 42 | if (certificate && Object.keys(certificate).length > 0) { |
| 43 | return certificate |
| 44 | } |
| 45 | debugAuth('No peer certificate received during TLS handshake.') |
| 46 | } |
| 47 | |
| 48 | export function setEmptySession (req) { |
| 49 | req.session.userId = '' |