Katkat

Explain TLS Handshakes and HTTPS Traffic Inspection

TikTokSoftware Engineer · Technical Screen

Last updated

Tests understanding of the TLS handshake, asymmetric vs. symmetric cryptography in HTTPS, certificate authority verification, and the mechanics of forward secrecy versus intercepting HTTPS proxies.

Context

Modern web services rely on HTTPS to guarantee confidentiality, data integrity, and server authenticity. As a software engineer working on client-server applications, you need a solid grasp of how secure connections are negotiated, how trust is established, and how encrypted traffic can (or cannot) be inspected for debugging or security auditing.

Question

Provide a comprehensive technical explanation addressing the following areas:

  1. The TLS Handshake & Cryptographic Roles

    • Walk through the core messages exchanged during a TLS 1.2 or TLS 1.3 handshake.
    • Explain why the handshake uses asymmetric cryptography (public-key cryptography) while application data payload transfer uses symmetric cryptography.
  2. Certificate Validation

    • How does a client (e.g., browser or mobile client) verify the authenticity of a server's digital certificate?
    • What checks are performed on the Certificate Authority (CA) chain, domain name, expiration, and revocation status?
  3. Traffic Inspection: Passive Capture vs. MITM Proxy

    • A network engineer captures network packets using a tool like Wireshark on an enterprise network where modern cipher suites with Ephemeral Diffie-Hellman (ECDHE) are in use. Can they decrypt the payloads simply by possessing the server's private key after the fact? Why or why not?
    • Explain how tools like Charles Proxy, Fiddler, or an enterprise security gateway successfully inspect HTTPS traffic, and what must be configured on the client device for this to work without certificate warning errors.

Hints

Hint 1

Consider the performance overhead differences between symmetric key operations (like AES-GCM) and asymmetric key operations (like RSA or ECC) when sending large data payloads.

Hint 2

Think about the trust store installed in an operating system or browser, and how parent CA signatures sign child certificates down the chain.

Hint 3

Look up Forward Secrecy (PFS): ephemeral session keys are never transmitted over the wire, even in encrypted form, meaning a compromised static server private key cannot retroactively decrypt past sessions.

Follow-up questions

  • How does TLS 1.3 optimize the handshake compared to TLS 1.2 to achieve a 1-RTT (or 0-RTT) connection time?
  • What is SSL/TLS Certificate Pinning, and how does it defend against malicious or unauthorized proxy interception on mobile devices?
  • What is the role of Server Name Indication (SNI), and how does Encrypted Client Hello (ECH) protect domain privacy on public networks?