Node.js AdvancedLesson 94Free preview
TLS/SSL Module
This lesson is part of Node.js · All levels
Summary
This lesson discusses the tls module for making encrypted connections (HTTPS, FTPS, and other secure protocols) in Node.js. You'll understand the concept of certificates, private keys, and TLS handshakes, and then make the server secure with tls.createServer or built-in https. Transport security is mandatory for sensitive data.
Key points
- TLS/SSL encrypts the connection and verifies the identity of the server via digital certificates.
- The server needs a pair of private keys and certificates (usually issued by CA like Let's Encrypt).
- Https.createServer is the layer above tls for HTTP over TLS.
- Important options: minVersion ('TLSv1.2'), ciphers, and rejectUnauthorized for the client.
- For production, make sure the certificate doesn't expire and use ALPN when you need HTTP/2.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.