Course contents

Unit 7: TCP, UDP and PortsLesson 7.3.2 (17 of 23 in this unit)66 of 104 in the Network Fundamentals course

HTTPS and TLS

How do you send a password across a network you do not control? HTTPS protects the conversation and checks the server identity, but you still need to check which site you opened.

Beginner · 7 min read

Covers TLS handshake, Certificates and Port 443.

Technical definition

HTTPS (HTTP Secure) is HTTP carried inside a TLS (Transport Layer Security) connection, which encrypts the traffic, detects tampering and lets the client verify the server’s identity through its certificate. HTTP/1.1 and HTTP/2 commonly use TLS over TCP port 443; HTTP/3 uses QUIC over UDP, normally on port 443, with TLS 1.3 integrated.

Logging in to a bank on café Wi-Fi

You log in to your bank on a café's free Wi-Fi. A person who can observe traffic along the path may see unprotected HTTP credentials; simply sharing Wi-Fi does not guarantee access to every packet. HTTPS protects the HTTP messages between the browser and its TLS endpoint. Check the actual domain name: an attacker can obtain a valid certificate for a lookalike name they control.

HTTP inside a TLS connection

HTTPS is normal HTTP sent inside a TLS connection. TLS (Transport Layer Security) sits between TCP and HTTP and provides three things:

  • Encryption: the data is encrypted so that only the two ends can read it.
  • Integrity: any change to the data in transit is detected.
  • Authentication: the server proves who it is with a certificate.

This lesson's handshake uses HTTPS over TCP port 443. HTTP/3 uses QUIC over UDP, normally port 443, with TLS 1.3 integrated into QUIC. TLS replaced an older protocol called SSL (Secure Sockets Layer), which is why people still say “SSL certificate”.

The TLS 1.3 handshake in one round trip

After the TCP handshake, the browser and the server run a TLS handshake. They agree on how to encrypt, exchange the values needed to build a shared secret key, and the server presents its certificate. A normal full TLS 1.3 handshake without a retry permits the client to send application data after one TLS round trip; TCP establishment is separate. This figure omits optional client certificates and session resumption:

Step 1 of 4 · ClientHello
Browser
192.168.1.20:51600
Internet
Web server
203.0.113.10:443
Secure session
Protocol:
TLS 1.3
Cipher:
TLS_AES_256_GCM_SHA384
Server identity:
example.com (verified)

Device key: Browser (laptop)

Arrows run from each message's sender to its receiver. Rows show message order, not separate cables or elapsed time to scale. Port numbers identify services or conversations, not physical switch sockets.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • Browser: 192.168.1.20:51600
  • Web server: 203.0.113.10:443

A certificate-authenticated key exchange derives shared secret material, then distinct handshake and application traffic keys. Finished messages check handshake integrity.

Figure 1. Full TLS 1.3 over TCP, simplified into message flights; no retry or resumption.

ServerHello is not the whole server handshake. Its key share lets the peers derive handshake keys. The following encrypted messages provide the certificate chain and proof of the server's private key. The server sends Finished before the client sends its own Finished. Application traffic uses derived keys, rather than transmitting a secret key across the network.

Why encryption needs certificates

Encryption alone is not enough, because you could set up an encrypted connection with an attacker. A certificate is a digital ID card that links a website name to a public key. It is signed by a certificate authority (CA), an organisation that checks that the site owner really controls the name.

Your browser and operating system ship with a list of trusted root CAs. A site's certificate is usually signed by an intermediate CA, which is in turn signed by a root CA. The browser follows this chain of trust up to a root it already trusts.

Diagram
Following the chain of trust
Following the chain of trust
Browsertrusted root listexample.comsite certificateIntermediate CARoot CAbuilt into the browser

Device key: Browser (laptop) · example.com, Intermediate CA, Root CA (server)

Lines show the example’s network connections. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

  1. 1. 1. Send the certificates. The server sends its own certificate plus the intermediate certificate.
  2. 2. 2. Check the signature. The site certificate is signed by the intermediate CA. Is the name correct, and is the certificate still valid?
  3. 3. 3. Climb the chain. The intermediate certificate is signed by a root CA that the browser already trusts, so the chain is valid.
Diagram
Why encryption needs certificates
Why encryption needs certificates
Browser checkIf it fails
The name on the certificate matches the site“Certificate name mismatch” warning
Today is between the start and end dates“Certificate expired” warning
The chain ends at a trusted root CA“Not trusted” warning (common with self-signed certificates)
Each item on the left, with what it means on the right.

A certificate warning is evidence to investigate. Check the requested name, device clock, certificate validity dates and intermediate chain. A self-signed certificate signs itself; it is not automatically trusted. For an authorised lab, verify its identity through a separate trusted channel or configure the lab CA. Do not train yourself to click past warnings on an unfamiliar site.

Diagram
Where HTTPS protection ends
Where HTTPS protection ends
Where HTTPS protection endsLogical application path: the browser establishes verified TLS to the front-end proxy at 203.0.113.10 port 443. That proxy decrypts HTTP and creates a separate TLS connection to the application at 10.20.0.10 port 443. These are two connections with different keys.1. Browser2. Reverse proxy3. ApplicationClient source port51544 (example)203.0.113.10:44310.20.0.10:443TLS connection ATLS connection BChecks site identityCan read HTTPUses different keysTLS endpoints determine who can read the message.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Figure 2. Two TLS connections: the front end can read HTTP because it terminates the browser connection. Arrows represent logical services, not Ethernet links.

Figure 2 shows a reverse proxy terminating HTTPS for the site. The browser validates the site certificate on connection A; the proxy validates its backend separately on connection B. Re-encrypting the backend traffic protects that hop, but the proxy still handles plaintext between the two connections. The addresses and source port are documentation examples; physical routing and NAT are omitted.

Turning on HTTPS management on a Cisco router

Many routers and switches have a web interface for management. If you use it, turn off plain HTTP and use only HTTPS. This IOS XE 17 command pattern assumes the platform supports HTTPS, with management addressing, authentication, certificates and access restrictions already planned. It is not a complete secure-management configuration and has not been run on a device. Start in privileged EXEC mode:

configure terminal

Enter global configuration mode on the authorised lab device.

no ip http server

Turn off the clear-text web server on TCP 80.

ip http secure-server

Turn on the HTTPS server on TCP 443. Many IOS versions create a self-signed certificate if none is configured.

end

Return to privileged EXEC mode before running show commands.

show ip http server secure status

Check that the secure server is enabled and see its port and ciphers.

Enabling the listener does not select a modern TLS version or restrict who can reach it. Check the exact platform/release guide, supported TLS settings, certificate trust and management access controls. Use an internal CA where appropriate. If web management is unnecessary, leave its services disabled.

Inspecting a TLS connection with curl

On Windows PowerShell, use the command below. -v shows connection details, -o NUL discards the body and --max-time 15 limits the operation. On Linux/macOS use curl and -o /dev/null. Do not include credentials in the URL or disable certificate verification.

curl.exe -v --max-time 15 https://example.com -o NUL

Inspect a TLS connection while keeping certificate verification enabled.

Example output
* Connected to example.com (203.0.113.10) port 443
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* Server certificate:
*  subject: CN=example.com
*  expire date: Dec 30 23:59:59 2026 GMT
*  issuer: C=US; O=Example Trust; CN=Example Intermediate CA
*  SSL certificate verify ok.

This is a constructed OpenSSL-style example; Windows Schannel builds and other curl TLS backends display different fields. The documentation address is illustrative, not a live DNS assertion. What to look for: the SSL connection using line shows the TLS version (TLSv1.3) and the cipher. subject is who the certificate belongs to, issuer is the CA that signed it and expire date is when it stops being valid. SSL certificate verify ok means the chain of trust and the name both checked out. The SSL Checker tool provides another view of certificate details for supported public targets.

Try it: identify the failure before changing settings

Request example.com with certificate verification enabled and record whether TLS completes before an HTTP status arrives. A timeout suggests investigating resolution, reachability, a firewall or the listener. A certificate-name error means the connection reached a TLS peer but the requested identity did not match. A 403 after verified TLS means an HTTP endpoint refused the request; adding trust certificates will not fix that application permission problem.

A valid certificate authenticates the requested name; it does not certify the site's business or content. The path, headers and body are protected across the TLS connection. IP addresses and traffic sizes remain observable. An authorised TLS-inspection proxy terminates one connection and creates another, so the proxy can read the HTTP messages. Endpoint malware is also outside this protection.

In an authorised lab, inspect the browser's certificate viewer and compare the hostname, issuer and dates with your expected service. If you correct a certificate or clock problem, repeat the request and verify both TLS success and the expected HTTP response. Do not deliberately enter passwords on a broken or untrusted connection.

Test yourself on HTTPS and certificates

Predict · scenario 1

You connect to https://example.com. Which part of the connection proves that the server really is example.com?

Predict · scenario 2

You browse to a router's HTTPS page and get a "not trusted" warning. Which listed condition can explain it?

Predict · scenario 3

With HTTPS, can someone on the same Wi-Fi read the path you request, such as /account/settings?

Technical references

RFC 8446: TLS 1.3 handshake and key schedule; RFC 9114: HTTP/3; curl command reference; Cisco IOS XE 17 HTTP services guide.