DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • How the Web Works
  • Browsers: The Engines
  • Networking & Latency
  • HTTPS & TLS Handshake
  • CDNs & Edge Computing
  • WebSockets & WebRTC
  • RESTful Architecture
  • GraphQL Architecture
  • CORS (Cross-Origin Resource Sharing)
  • Load Balancing
  • Critical Rendering Path Deep Dive
  • DOM vs. CSSOM Construction
  • The Rendering Engine: Layout, Paint, Compositing
  • JavaScript Engine: V8 Internals
  • The Event Loop: Macro vs. Micro Tasks
  • Garbage Collection
  • Browser Storage Architecture
  • Service Workers & PWAs
  • Web Workers: Multi-Threading
← From Beginner to Expert in Fundamentals of Frontend

HTTPS & TLS Handshake

20 min read
HTTPSTLS 1.3Asymmetric EncryptionSymmetric EncryptionCertificate AuthoritySSL Pinning

How HTTPS Secures Every Request

Every time you see the padlock icon in your browser, a complex cryptographic ceremony has just occurred in milliseconds. Understanding this process is critical for any frontend developer who cares about security.

The TLS Handshake (TLS 1.3 — Modern Standard)

TLS 1.3 reduced the handshake from 2 round-trips (TLS 1.2) to just 1 round-trip, dramatically improving page load times.

Step-by-Step:

  1. Client Hello: Your browser sends supported cipher suites and a random number to the server.
  2. Server Hello + Certificate: The server responds with its chosen cipher suite, its SSL certificate (containing the public key), and its own random number.
  3. Key Exchange: The client verifies the certificate against a Certificate Authority (CA), then both sides use Diffie-Hellman key exchange to generate a shared secret — without ever transmitting it.
  4. Symmetric Encryption Begins: All subsequent data is encrypted with the shared secret using fast symmetric encryption (AES-256-GCM).

Asymmetric vs. Symmetric Encryption

PropertyAsymmetric (RSA/ECDSA)Symmetric (AES)
KeysPublic + Private key pairSingle shared key
Speed~1000x slowerVery fast
Used ForKey exchange, signaturesBulk data encryption
ExampleTLS handshakeEncrypting page data

Certificate Authorities (CAs)

CAs are trusted third parties (like Let's Encrypt, DigiCert) that vouch for a server's identity. Your browser ships with a list of ~150 trusted root CAs. If a certificate is not signed by one of these, you see the "Not Secure" warning.

Why Frontend Devs Must Care

  • Mixed Content: Loading an HTTP image on an HTTPS page will be blocked by modern browsers.
  • HSTS (HTTP Strict Transport Security): Tells browsers to ONLY connect via HTTPS — prevents downgrade attacks.
  • Certificate Pinning: Mobile apps can "pin" a specific certificate to prevent man-in-the-middle attacks.

Performance Impact

TLS 1.3's 1-RTT handshake + 0-RTT resumption (for returning visitors) means HTTPS adds almost zero latency. There is no longer any performance excuse to use HTTP.

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.