Study Guide

HTTPS: TCP, TLS and web communication

Follow a web request through DNS, TCP, TLS and local delivery, with certificate, key and socket explanations.

Lesson 3.12 Networking Fundamentals

Visiting a secure website brings together almost everything in this module: names and addresses, ports, routing and encryption. This lesson follows one request from the moment an address is typed to the moment the page appears, and works out what the padlock in the browser does and does not protect.

Stage: Think

One second, one page

Think it through

You type a website’s name into a browser and the page appears about a second later. List everything the laptop must find out or set up in that second before it can show the page.

Show what happens

At least four things: the server’s address, found from its name; a connection to it; a way to be sure it is the real site and to keep the conversation private; and finally the request for the page itself. The lesson follows them in that order.

Think it through

Which of these must happen first?
Show the answer

Answer: B. Finding the server’s address.

Finding the address. Each job needs the one before it: you cannot connect without an address, or protect a connection that does not exist yet.

Stage: Explain

Start with a website address

A pupil on a school laptop types https://www.example.com/ into a browser and presses Enter. About a second later the page appears. In that second, four things happen in a fixed order.

One page request: four jobs in order

The whole journey, one job at a time. Each job needs the one before it: the browser cannot connect before it has an address, or protect a connection that does not yet exist.

  1. DNS

    Step 1 of 4: Find

    Turn the name www.example.com into an IP address.

  2. TCP

    Step 2 of 4: Connect

    Open a reliable connection to that address, on port 443.

  3. TLS

    Step 3 of 4: Secure

    Check the server is the real one, and agree a secret key with it.

  4. HTTP

    Step 4 of 4: Ask and answer

    Send the request for the page and receive it, both encrypted with that key.

Think it through

Look at jobs 3 and 4 of the journey. What do you think HTTPS is?
Show the answer

Answer: A. HTTP carried inside TLS.

HTTP, the rules for asking for web pages, carried inside TLS, which protects it.

HTTPS is not a separate technology. It is HTTP, the rules for asking for and sending web pages, carried inside TLS, which protects it. Underneath, TCP delivers the data reliably and IP gets it to the right computer, as the earlier lessons described.

In this example the web server’s address is 198.51.100.20, an address reserved for examples, and the laptop’s is 192.168.1.10.

Stage: Predict

1. Find the server with DNS

Think it through

You know a friend’s name but not their phone number. How do you find the number? How might a laptop find the address for www.example.com?

Show what happens

Look it up in a directory. The internet has one: give it a name, and it returns the address.

Computers find each other by IP address, and people remember names. DNS (the Domain Name System) is the internet’s phone book: give it a name, and it returns the number.

The laptop asks, “what is the address of www.example.com?”, and receives the answer 198.51.100.20. If it asked the same question a few minutes ago, it reuses the answer it kept.

  1. The laptop checks its own cache for a recent answer.
  2. If there is none, it asks its configured DNS resolver, often supplied by DHCP, commonly over UDP port 53.
  3. If the resolver has no cached answer, it works through the DNS hierarchy on the laptop’s behalf until it finds a server that holds the answer for that domain.
  4. The answer, such as an IPv4 address record, comes back to the laptop, and both the resolver and the laptop keep it for a time.

Because ordinary DNS queries are not encrypted, they can reveal which sites a device is looking up, even when the sites themselves use HTTPS.

Think it through

DNS returned 198.51.100.20. Does that prove the server at that address is the real www.example.com?
Show the answer

Answer: B. No: it says only where to connect.

No. DNS says where to connect; it does not prove who answers there.

DNS is a separate service, not part of HTTPS. It tells the browser where to connect. It does not prove that whatever answers at that address is the real website. Proving that is TLS’s job, in step 3.

The laptop also needs its own network settings and a way out of the school’s network, which DHCP and ARP provided earlier.

Stage: Predict

2. Establish TCP transport

The browser now opens a connection from the laptop to the server. In the notation of TCP, UDP, Ports and Sockets:

192.168.1.10:51542 → 198.51.100.20:443

Port 443 is the agreed port for HTTPS. Port 51542 is a temporary port the laptop chose for its own end. (On the way out, the school’s router swaps the laptop’s private address for a public one, as IP forwarding, default gateways and NAT/PAT explained.)

Think it through

Before two people talk on the telephone, one rings, the other answers, and the first confirms they can hear. Why might two computers do something similar before sending a web page?

Show what happens

Each side needs to know that the other is there and ready before data flows. TCP does this with three messages.

TCP begins with its three-message handshake: SYN (synchronise), SYN-ACK and ACK (acknowledge).

TCP: establish transport before negotiating TLS

A simplified exchange between the laptop and the web server, message by message. Arrows show which way each message travels, not a direct physical cable.

  1. Step 1: Laptop to Web server. SYNI would like to open a connection.
  2. Step 2: Web server to Laptop. SYN-ACKAgreed, and I am ready too.
  3. Step 3: Laptop to Web server. ACKConfirmed. The connection is open.

From here, TCP numbers the data it sends, has the other side confirm what arrived, and resends anything that was lost. The result is a connection that delivers everything, in order.

Think it through

TCP now delivers everything, in order, and resends anything lost. Is the connection private, and is the server proven genuine?
Show the answer

Answer: C. Neither, yet.

Neither, yet. TCP makes the connection reliable, not private or authenticated.

What TCP does not do matters just as much: it does not encrypt anything, and it does not check who is at the other end. At this point the laptop has a reliable connection to something at 198.51.100.20.

Go deeper What the server was doing before the laptop called

A web server program asks its operating system for a socket on port 443 and waits, which is called listening. When a handshake arrives and the firewall allows it, the operating system completes it and hands the new connection to the program. If nothing is listening on a port, the connection is refused; a firewall may instead silently discard the attempt. Many clients can use port 443 at once, because each connection has a different combination of client address and client port.

Stage: Predict

3. Negotiate TLS security

The connection is reliable but open: anyone on the path could read it, and nothing has shown that the server is genuine. TLS (Transport Layer Security) fixes both, by doing three jobs.

Job 1: check that the server is who it claims to be. The server presents a certificate. Think of it as an identity card for the website, issued by a trusted organisation called a certificate authority. The browser checks that the card names www.example.com, is in date, and was issued by an authority the browser trusts. The server also has to prove that the card is its own, not a copy. Public Key Infrastructure and Digital Certificates explains how.

Think it through

Both sides need the same secret key, but anyone on the path can read what they send. What is wrong with simply sending the key?

Show what happens

Anyone watching would read it and could then decrypt everything. The key has to be agreed without ever being sent, which sounds impossible.

Job 2: agree a secret key without ever sending it. The two sides each contribute something, exchange some values in the open, and both arrive at the same secret key. Someone watching every message still cannot work the key out. That sounds impossible; Transport Encryption, Key Agreement and Forward Secrecy shows how it is done.

Job 3: encrypt everything with that key. From now on, both sides scramble what they send using the shared key, called a session key because it lasts only for this conversation.

TLS: agree keys and authenticate the server

The TLS handshake grouped into four stages by purpose, between the laptop and the web server. It is a summary, not a list of every message.

  1. Step 1: Laptop to Web server. HelloHere are the kinds of protection I support, and my contribution towards a shared key.
  2. Step 2: Web server to Laptop. HelloI choose this kind of protection, and here is my contribution. Both sides can now work out the same key.
  3. Step 3: Web server to Laptop. Certificate and proofHere is my certificate, and proof that it is mine.
  4. Step 4: Laptop to Web server. Checked: confirmThe laptop checks first: the name matches, the certificate is in date and it trusts who issued it. Then it confirms. Everything after this is encrypted.

Check your understanding

A certificate is in date and issued by a trusted authority, but names a different website. What should the browser do?
Show the answer

Answer: C. Warn: it cannot confirm who it is talking to.

Warn. The certificate must name the site, be in date and come from a trusted authority; one failure means the browser cannot confirm who it is talking to.

If the browser’s checks fail, it shows a warning instead of the page. A warning means job 1 failed: the browser could not confirm who it is talking to. It is not a formality to click through.

Go deeper The TLS 1.3 message names and what this summary leaves out

In the current version, TLS 1.3, the four stages of the handshake diagram are these messages:

  • ClientHello: the client’s supported options and its key share, which is its contribution to the key. The key share is ephemeral: made for this connection and thrown away afterwards.
  • ServerHello: the server’s choice and its own key share. Both sides now derive the keys.
  • Certificate, CertificateVerify and Finished: the server sends its certificate with the certificates that link it to a trusted authority (the certificate chain), proves that it holds the matching private key (CertificateVerify) and confirms the whole exchange (Finished). These messages are already encrypted.
  • The client’s Finished, sent once its checks pass.

The certificate’s key is used to prove identity. It is not used to encrypt the web pages, and the server’s long-term private key is not the session key. This summary describes a new connection in which only the server is identified. It leaves out resuming an earlier session and asking the client for a certificate too. The TLS 1.3 specification has the detail.

Stage: Predict

4. Send the protected HTTP request

Only now does the browser ask for the page. Before TLS protects it, the request is a few lines of plain text:

GET / HTTP/1.1
Host: www.example.com
Accept: text/html

GET / means “send me the home page”. TLS encrypts those lines with the session key, and TCP carries the result. Someone watching the connection sees scrambled data: they cannot read the request or change it without being detected.

Think it through

TLS protects the request on its way. Can malicious software inside the browser read it?
Show the answer

Answer: B. Yes, before it is encrypted.

Yes: the request exists in plain text inside the browser before it is encrypted, and inside the server after it is decrypted.

The protection covers the journey, not the two ends. The server decrypts the request in order to read it, so a server that has been broken into, or a browser with malicious software in it, sees everything.

Stage: Predict

5. Receive and render the response

The server reads the request, finds the page and sends it back, encrypted with the same session key. The browser decrypts it and draws the page. The page usually refers to images and other files, which the browser requests over the same connection, without repeating steps 1 to 3.

The result: the pupil sees the page, about a second after pressing Enter.

Think it through

Someone is watching the school’s network during that second. Before looking at the table, which could they see: the name looked up, the server’s address, the page requested, what was typed into a form?

Show what happens

The name looked up and the server’s address are visible; the page and anything typed are not. The table explains why.

Here is the same second from the point of view of someone watching the school’s network.

What an observer could seeVisible?Why
That the laptop looked up www.example.comYesOrdinary DNS lookups are not encrypted.
That the laptop connected to 198.51.100.20 on port 443YesAddresses and ports must be readable for the data to be delivered.
When, and roughly how much data was exchangedYesTiming and size cannot be hidden by encryption.
Which page was requested and what it containedNoTLS encrypted the request and the response.
Anything typed into a form on the pageNoIt travels inside the same encrypted connection.

That table is the honest meaning of the padlock.

Stage: Explain

How does a protocol make this happen?

A protocol is a set of agreed rules. Software follows them: the browser writes the HTTP messages, a TLS component does the checking and encrypting, and the operating system runs TCP and IP. The network card sends and receives the result without needing to understand any of it.

Basic elementRole in this example
ApplicationThe browser creates the request and consumes the response
ProtocolsHTTP, TLS, TCP, IP and link protocols coordinate different responsibilities
NICSends and receives network data through the interface
Transmission mediaCopper, fibre or radio carries physical signals

Check your understanding

The laptop’s cable is in switch port 5 and the connection uses TCP port 443. Which does the switch use to choose where to send a frame?
Show the answer

Answer: A. Its destination MAC.

The destination MAC address. The switch never looks at the TCP port.

Two different things here are called “port”. Suppose the laptop’s cable is plugged into switch port 5: a physical socket. TCP port 443 is a number in software. The switch chooses where to send a frame from the destination MAC address, and never looks at the TCP port.

For a server outside the school, the frame leaving the laptop is addressed to the gateway’s MAC address while the packet inside is addressed to the web server’s IP address. The forwarding walkthrough follows that distinction, and the OSI overview places each protocol in its layer.

Stage: Predict

What HTTPS does not hide

HTTPS protects the content of the conversation. It does not hide that the conversation took place. IP addresses, timing and the amount of data remain visible, and DNS lookups reveal names unless they are protected separately.

A pupil at a fictional school reads an advice page on a charity’s website over HTTPS.

  1. The lookup. The laptop asks DNS for the charity’s address. Unless DNS is protected separately, the school’s network can see the name that was looked up.
  2. The connection. The network sees the laptop connect to the charity’s server address on port 443, when, and roughly how much data passes.
  3. The content. It cannot see which page was read or anything typed into a form: TLS encrypted them.

The result: the network can tell which site was visited, but not what was read there.

Think it through

A criminal sets up a convincing fake shop on a domain they own. Could the site show a valid certificate and a padlock?
Show the answer

Answer: C. Yes: it proves the name, not honesty.

Yes. A certificate shows that the browser reached the site named in the address bar, not that the site is honest.

A valid certificate also says nothing about whether a website is honest. It shows that the browser reached the site named in the address bar. A criminal can obtain a perfectly valid certificate for a site they own.

Stage: Explain

HTTP/3 uses a different transport sequence

Everything so far in this lesson describes HTTPS over TCP, which is what the older versions of HTTP (HTTP/1.1 and HTTP/2) use. The newest version, HTTP/3, does not use TCP at all. It runs over a protocol called QUIC, which runs over UDP, usually on UDP port 443. QUIC builds in TLS 1.3 and its own reliable delivery, so there is no separate TCP three-way handshake and the page is still encrypted. See the HTTP/3 specification.

So the four-step order in this lesson is typical for a new connection over TCP, not a rule for every page load. A cached DNS answer skips step 1, a connection that is already open skips steps 1 to 3, and HTTP/3 replaces step 2.

Check your understanding

The laptop opened a page on the same site a minute ago, and the connection is still open. Which jobs does the next request skip?
Show the answer

Answer: B. Finding, connecting and securing.

Steps 1 to 3: the address is known and the connection is already open and protected, so only the request and response remain.

Certificate warnings are worth taking seriously. A mismatched name or an untrusted certificate can mean a misconfigured site, but it can also mean someone is intercepting the connection. Report it rather than clicking through, especially on a work device.

Stage: Apply

Apply it in a new situation

These questions use the lesson in situations it has not shown. For the strongest test of your understanding, come back to them on another day and answer each one at the first attempt.

Apply it

On a café’s Wi-Fi, a friend checks their bank balance over HTTPS. What could the café’s network owner learn?
Show the answer

Answer: A. That they used the bank, and when.

That they visited the bank, when, and roughly how much data was exchanged; not the balance, the pages or anything typed.

Apply it

A work laptop shows a certificate warning for the company’s payroll site. A colleague says to click through because “it is our own site”. What do you do?
Show the answer

Answer: C. Report it rather than click through.

Report it. The warning means the browser could not confirm the server’s identity: a misconfiguration, or someone intercepting the connection.

Apply it

A browser says “server not found” for a site that opens on your phone over mobile data. Which of the four jobs failed?
Show the answer

Answer: A. Finding the address.

Finding the address: “not found” means the name could not be turned into an address, so nothing after it could start.

Stage: Check

Check your understanding

These questions come from the approved revision bank. Choose an answer and check it; the explanation and its sources follow.

  1. A Wi-Fi laptop accesses an Ethernet-connected HTTPS server. Which explanation is accurate?

    Show answer

    Answer: Compatible higher-layer protocols enable communication; HTTP/3 uses QUIC over UDP.

    Different physical technologies can communicate through compatible higher layers. HTTP defines web messages and TLS secures them; HTTP/3 uses QUIC over UDP, while HTTP/1.1 and HTTP/2 commonly use TCP 443. UDP does not imply an absence of encryption.

    Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record)

  2. A browser loads a fictional HTTPS website using HTTP/2. A colleague says this connection is secured with TLS over UDP port 443. Which correction is accurate?

    Show answer

    Answer: HTTPS is HTTP secured with TLS; HTTP/2 commonly uses TCP port 443, so the connection starts with the TCP handshake. QUIC over UDP port 443 is used by HTTP/3.

    HTTPS uses HTTP with TLS, HTTP/1.1 and HTTP/2 commonly use TCP port 443, and HTTP/3 uses QUIC over UDP port 443. A TCP connection starts with SYN, SYN-ACK and ACK. The colleague has described HTTP/3, not HTTP/2. TLS does not replace the transport protocol, and HTTPS is not carried on port 80.

    Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record)

  3. A browser visits https://shop.example for the first time using HTTP/2 over TCP. It has no cached DNS answer for the name and no existing connection to the server. Which order of steps is typical?

    Show answer

    Answer: DNS resolution, then TCP connection to port 443 (SYN, SYN-ACK, ACK), then TLS handshake, then encrypted HTTP request and response.

    A simplified sequence for HTTPS over TCP is: resolve the server’s IP address, using DNS when necessary; establish a TCP connection, typically to port 443, with SYN, SYN-ACK and ACK; perform the TLS handshake, which authenticates the server and establishes keys; then exchange encrypted HTTP. TLS needs the TCP connection to exist first, and HTTP is only sent once TLS protection is in place. This is the typical order for a fresh connection: a cached DNS answer or a reused connection skips steps, and HTTP/3 does not use a TCP handshake at all.

    Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record) · HTTPS: TCP, TLS and web communication (Supplementary Study Guide explanation)

  4. A fictional user opens https://bank-login.example, and the browser’s certificate validation succeeds for that hostname. Which statements are accurate? Select all that apply.

    Show answer

    Answer: TLS protects the HTTP requests and responses in transit for confidentiality and integrity.; The connection authenticates the server for bank-login.example through successful certificate validation and the TLS handshake.

    TLS provides encryption, integrity protection and authentication, and the TLS handshake authenticates the server. Authentication rests on successful certificate validation for the hostname, so it authenticates the server for bank-login.example; it does not show that the name belongs to a genuine bank. TLS also has limits: it does not make an operator trustworthy, does not hide IP addresses, timing or traffic volume, and cannot protect data from a compromised browser, which sees the decrypted content.

    Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record) · HTTPS: TCP, TLS and web communication (Supplementary Study Guide explanation)

  5. A fictional troubleshooting guide says: “Every HTTPS page load begins with a TCP three-way handshake to port 443.” A colleague notices that the browser is loading the site over HTTP/3. Which correction is accurate?

    Show answer

    Answer: HTTP/3 uses QUIC over UDP, so there is no TCP three-way handshake; the guide should describe the TCP sequence as typical for a new HTTP/1.1 or HTTP/2 connection.

    Modern HTTP/3 uses QUIC over UDP rather than TCP, so a TCP three-way handshake cannot be universal to HTTPS. QUIC integrates TLS 1.3 security, so HTTP/3 traffic is still protected, and even over TCP a browser may reuse an existing connection, so “every page load” overstates the rule. The TCP sequence is typical for a new HTTP/1.1 or HTTP/2 connection.

    Revision sources: Session 5: Networking Fundamentals — Part 1 (Classroom session record) · HTTPS: TCP, TLS and web communication (Supplementary Study Guide explanation)

Study and revision

Return to TCP, UDP, Ports and Sockets or the Networking & Protocols revision topic. Its questions cover foundational ports, compatible protocol stacks, TCP handshake order, the transports used by HTTP/2 and HTTP/3, the typical order of a new HTTPS connection and what TLS does and does not protect; a flashcard recalls the limits of TLS. Items that use this lesson’s supplementary explanation say so in their explanations. They are learning-only.

Stage: Consolidate

What to remember

  • A new HTTPS page load does four jobs in order: find the address (DNS), connect (TCP), secure (TLS), then ask and answer (HTTP).
  • DNS says where to connect; it proves nothing about who answers.
  • TCP makes the connection reliable, but neither private nor authenticated.
  • TLS checks the server’s certificate, agrees a session key without sending it, and encrypts the conversation.
  • HTTPS hides content, not the fact of the conversation; a padlock does not mean a site is honest.

Key terms

DNS (Domain Name System)

The system that translates domain names into IP addresses. It commonly uses port 53 over UDP and TCP.

TLS (Transport Layer Security)

A protocol that protects data in transit with encryption for confidentiality and with integrity protection, and authenticates the server when certificate validation succeeds. HTTPS uses it to secure web traffic.

HTTPS (Hypertext Transfer Protocol Secure)

HTTP protected by TLS. HTTP/1.1 and HTTP/2 commonly use TCP port 443, while HTTP/3 uses QUIC over UDP port 443.

Common misunderstandings

The padlock means the connection is protected and the certificate matched the name. It says nothing about whether the site or its owner is trustworthy.

Content is protected, but IP addresses, timing, traffic volume and ordinary DNS lookups can still be observed.

DNS is a separate service that finds the address. HTTPS starts only once the browser knows where to connect.

Lesson sources and acknowledgements

Sources and scope

This lesson develops the additional educational explanations from my Session 5 ChatGPT note-taking discussion, alongside the approved Learning Log. The scenario is illustrative, not a tutor quotation, packet capture or completed lab; 198.51.100.20 is a documentation address and says nothing about the real records for example.com. The log records the taught material and technical corrections; this page explains how the pieces work together.

  • Taught in Session 5 (see the Session 5 Learning Log): HTTPS as HTTP secured with TLS, the simplified connection sequence, DNS resolution, TCP port 443, the TCP three-way handshake, TLS providing encryption, integrity protection and authentication, and HTTP/3 using QUIC over UDP.
  • Supplementary explanation: the four-jobs overview, the DNS resolution steps, the three jobs of TLS and the identity-card comparison, the certificate-validation and key-exchange detail in the “Go deeper” notes, the observer’s table, what HTTPS does not hide, the caveats about cached, reused and HTTP/3 connections, the misunderstandings and the practical note. The diagrams are original.
  • Where the full explanation is: certificates, certificate authorities and key agreement are taught from the beginning in Module 6. This lesson describes what they achieve and leaves how they work to lessons 6.5 and 6.9.

Guided version (published 1 November 2026, awaiting the site owner’s editorial review): the one-second opening questions, every question asked in the lesson with its feedback and hints, the application questions and the closing summary are supplementary explanation written for the Study Guide. The settings are fictional. The questions in the lesson’s steps are not revision-bank items; those in “Check your understanding” are, unchanged.