Q49: How is mutual TLS (mTLS) implemented using the Node.js tls module?
Mutual TLS (mTLS) requires both server and client to authenticate each other using X.509 digital certificates. In Node.js, this is implemented using the tls or https module by setting requestCert: true and rejectUnauthorized: true alongside specifying trusted Certificate Authorities (ca), server certificates (cert), and private keys (key).
Key Takeaways
- mTLS enforces bidirectional identity verification using SSL certificates.
- Configured via
tls.createServer()withrequestCert: trueandrejectUnauthorized: true.
Knowledge Check
Which TLS option instructs a Node.js server to reject incoming client connections that lack valid certificates?