HTTP vs HTTPS – SSL/TLS, Certificates & Security

1. What is HTTP?

HTTP (Hypertext Transfer Protocol) is the application-layer protocol that defines how web browsers and web servers communicate. It is a request-response protocol: the client (browser) sends a request and the server replies with a response. HTTP is stateless — each request is independent; the server holds no memory of previous requests unless additional mechanisms (cookies, sessions) are used.

  HTTP Request/Response Flow:

  Browser                                Web Server
    │                                        │
    │── TCP SYN ──────────────────────────▶  │
    │◀─ TCP SYN-ACK ──────────────────────   │
    │── TCP ACK ──────────────────────────▶  │  (TCP 3-way handshake on port 80)
    │                                        │
    │── HTTP GET /index.html HTTP/1.1 ─────▶ │  (Request — PLAINTEXT)
    │   Host: example.com                    │
    │                                        │
    │◀─ HTTP/1.1 200 OK ──────────────────   │  (Response — PLAINTEXT)
    │   Content-Type: text/html              │
    │   <html>...page content...</html>       │

  Problem: Everything above is readable by anyone who can intercept the traffic

Related pages: DNS Purpose | DNS Lookup | DNS Configuration | Firewalls | OSI Model | Wireshark

2. What is HTTPS?

HTTPS (Hypertext Transfer Protocol Secure) is HTTP wrapped inside a TLS (Transport Layer Security) tunnel. The request-response model is identical to HTTP, but before any HTTP data is exchanged, a TLS handshake establishes an encrypted channel. Everything transmitted — URLs, headers, cookies, form data, responses — is encrypted end-to-end.

  HTTPS Connection Flow:

  Browser                                Web Server
    │                                        │
    │── TCP SYN ──────────────────────────▶  │
    │◀─ TCP SYN-ACK ──────────────────────   │
    │── TCP ACK ──────────────────────────▶  │  (TCP handshake on port 443)
    │                                        │
    │═══════ TLS HANDSHAKE ══════════════════│  (Certificate exchange,
    │        (see Section 5)                 │   key agreement — BEFORE
    │════════════════════════════════════════│   any HTTP data flows)
    │                                        │
    │── [ENCRYPTED] GET /index.html ───────▶ │  (Request — encrypted)
    │◀─ [ENCRYPTED] 200 OK + content ──────  │  (Response — encrypted)

  An interceptor sees only: [encrypted bytes] — cannot read content or URL path

3. HTTP vs HTTPS — Full Comparison

Feature HTTP HTTPS
Port number 80 443
URL prefix http:// https://
Encryption None — all data transmitted in plaintext TLS encryption — all data encrypted end-to-end
Data security Vulnerable to interception, eavesdropping, and modification Protected — interceptor sees only encrypted bytes
Server authentication None — client cannot verify it is talking to the real server Yes — server identity proven by digital certificate signed by a trusted CA
Data integrity No protection — content can be silently modified in transit HMAC (Hash-based Message Authentication Code) detects any tampering
Browser indicator "Not Secure" warning (Chrome/Firefox) on pages with input fields Padlock icon in address bar
SEO ranking Lower — Google has used HTTPS as a ranking signal since 2014 Higher — Google favours HTTPS sites in search results
HTTP/2 support Limited — HTTP/2 is technically possible over plaintext but no major browser supports it Full — all browsers require TLS for HTTP/2 (h2)
Cookie security Cookies transmitted in plaintext — can be stolen by attacker Cookies encrypted; Secure flag ensures cookies only sent over HTTPS
OSI layer Application Layer (Layer 7) Application Layer (Layer 7) over TLS (Session Layer / Layer 5–6)

4. HTTP Methods

HTTP defines a set of request methods (also called verbs) that indicate the action to be performed on the resource identified by the URL. These apply to both HTTP and HTTPS.

Method Action Request Body? Typical Use
GET Retrieve a resource No Loading a web page, fetching images, API read requests
POST Submit data to be processed Yes Form submissions, login credentials, file uploads
PUT Replace a resource entirely Yes REST API — full update of a record
PATCH Partially update a resource Yes REST API — partial update (change one field)
DELETE Delete a resource No REST API — remove a record
HEAD Retrieve headers only (no body) No Check if a resource exists; get metadata without downloading content
OPTIONS Describe communication options for the target resource No CORS preflight requests; API capability discovery
Security implication of GET vs POST: GET parameters appear in the URL (e.g., ?user=john&pass=secret) which is logged in browser history, server access logs, and proxy logs — never use GET for sensitive data. POST parameters go in the request body and are not visible in the URL. However, neither GET nor POST provides confidentiality over HTTP — both are plaintext. Only HTTPS encrypts the body and the URL path.

5. HTTP Status Codes

Every HTTP response includes a three-digit status code that describes the outcome of the request. Status codes are grouped into five classes.

Class Range Meaning Common Examples
1xx 100–199 Informational — request received, processing continues 100 Continue, 101 Switching Protocols (WebSocket upgrade)
2xx 200–299 Success — request received, understood, and processed 200 OK, 201 Created, 204 No Content
3xx 300–399 Redirection — client must take additional action 301 Moved Permanently, 302 Found (temp redirect), 304 Not Modified (use cache)
4xx 400–499 Client Error — request has an error 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests
5xx 500–599 Server Error — server failed to fulfil a valid request 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout
HTTP to HTTPS redirect: When a web server forces all HTTP traffic to HTTPS, it returns 301 Moved Permanently with a Location: https://... header. The browser then makes a new request to the HTTPS URL. A 301 is cached by the browser, so subsequent visits go directly to HTTPS without an HTTP round trip.

6. SSL and TLS — Version History

SSL (Secure Sockets Layer) was the original encryption protocol developed by Netscape in the 1990s. It was superseded by TLS (Transport Layer Security), which is the modern standard. Despite TLS being the correct term, the term "SSL" is still widely used colloquially.

Protocol Year Status Notes
SSL 1.0 1994 Never released — critical flaws found Internal Netscape only
SSL 2.0 1995 Deprecated — must be disabled Multiple serious vulnerabilities; DROWN attack
SSL 3.0 1996 Deprecated — must be disabled POODLE attack (2014); completely broken
TLS 1.0 1999 Deprecated (RFC 8996) BEAST attack; PCI-DSS requires disabling since 2018
TLS 1.1 2006 Deprecated (RFC 8996) Major browsers removed support in 2020
TLS 1.2 2008 Current — widely deployed Secure when configured with modern cipher suites; still the minimum required by PCI-DSS
TLS 1.3 2018 Current — recommended Faster handshake (1-RTT vs 2-RTT); removed legacy cipher suites; forward secrecy mandatory; all major browsers support
Exam tip: On the CCNA exam, TLS 1.2 and TLS 1.3 are the current standards. SSL 2.0, SSL 3.0, TLS 1.0, and TLS 1.1 are all deprecated and should be disabled on any modern server. Any question referring to "SSL" in a modern context is almost certainly referring to TLS.

7. The TLS Handshake — Step by Step

The TLS handshake is the process by which the browser and server agree on encryption parameters and establish a shared secret key before any application data flows. TLS 1.2 and TLS 1.3 use slightly different handshake flows; below is TLS 1.2 (the more commonly tested version).

  TLS 1.2 Handshake (2 Round Trips — 2-RTT):

  Browser (Client)                          Web Server
       │                                        │
       │── ClientHello ─────────────────────▶   │
       │   TLS version supported (max 1.2)      │
       │   Cipher suites supported              │
       │   Client Random (32 random bytes)      │
       │                                        │
       │◀─ ServerHello ──────────────────────   │
       │   Selected TLS version                 │
       │   Selected cipher suite                │
       │   Server Random (32 random bytes)      │
       │                                        │
       │◀─ Certificate ──────────────────────   │
       │   Server's digital certificate         │
       │   (contains server's public key)       │
       │                                        │
       │◀─ ServerHelloDone ──────────────────   │
       │                                        │
  [Browser validates certificate:              │
   - Is the CA trusted? (check CA root store)  │
   - Is it expired?                            │
   - Does CN/SAN match the hostname?           │
   - Is it revoked? (OCSP/CRL check)]          │
       │                                        │
       │── ClientKeyExchange ───────────────▶   │
       │   Pre-master secret encrypted with     │
       │   server's public key                  │
       │                                        │
  [Both sides derive the same session keys     │
   from: pre-master secret + client random     │
   + server random → Master Secret → Keys]     │
       │                                        │
       │── ChangeCipherSpec ────────────────▶   │
       │── Finished (encrypted) ────────────▶   │
       │◀─ ChangeCipherSpec ─────────────────   │
       │◀─ Finished (encrypted) ─────────────   │
       │                                        │
       │══ ENCRYPTED HTTP DATA FLOWS ══════════ │

TLS 1.3 Improvements

  • 1-RTT handshake — completes in one round trip instead of two, reducing latency
  • 0-RTT session resumption — previously connected clients can send data in the very first message (with some security trade-offs)
  • Forward Secrecy mandatory — every session uses ephemeral key exchange (ECDHE); compromise of the server's private key cannot decrypt past sessions
  • Removed insecure options — RSA key exchange, MD5/SHA-1, RC4, DES, and 3DES cipher suites all removed; only AEAD (Authenticated Encryption) allowed

8. Digital Certificates and Certificate Authorities

A digital certificate (X.509 certificate) is an electronic document that binds a public key to an identity (domain name, organisation) and is digitally signed by a trusted third party — a Certificate Authority (CA). Browsers and operating systems ship with a pre-installed list of trusted root CAs. When a server presents a certificate signed by one of these trusted CAs, the browser accepts it as proof of identity.

Certificate Types

Type Validation Level What Is Verified Browser Indicator Use Case
DV (Domain Validation) Low Domain ownership only — CA confirms you control the domain Padlock Blogs, personal sites, most HTTPS deployments; issued in minutes (Let's Encrypt)
OV (Organisation Validation) Medium Domain + legal organisation identity verified by CA Padlock Business websites where organisation identity matters
EV (Extended Validation) High Domain + rigorous legal/physical/operational verification Padlock (some browsers showed green bar — now deprecated in modern browsers) Banks, financial institutions, government sites — highest trust indication
Wildcard DV or OV Domain + all immediate subdomains (*.example.com) Padlock Organisations with many subdomains (mail.example.com, api.example.com, etc.)
SAN / Multi-Domain DV or OV Multiple distinct domains in one certificate (Subject Alternative Names) Padlock Hosting multiple sites on one server; example.com, example.org, example.net in one cert

Certificate Chain of Trust

  Root CA (self-signed, pre-installed in OS/browser trust store)
       │
       │ signs
       ▼
  Intermediate CA (signed by Root CA)
       │
       │ signs
       ▼
  Server Certificate (example.com — signed by Intermediate CA)

  Browser verification:
  1. Server sends: [Server Cert] + [Intermediate CA Cert]
  2. Browser checks: Is Intermediate CA signed by a Root CA I trust?
  3. Browser checks: Is Server Cert signed by this Intermediate CA?
  4. Browser checks: Is the certificate valid today? (not expired)
  5. Browser checks: Does CN or SAN match the hostname I'm connecting to?
  6. Browser checks: Is the certificate revoked? (OCSP stapling)
  → All pass → Padlock shown → Encrypted connection established

9. HTTPS Security Benefits — Confidentiality, Integrity, Authentication

HTTPS provides three distinct security properties, each protecting against different attack vectors.

Property What It Protects Without HTTPS (HTTP) With HTTPS
Confidentiality Content of communications — usernames, passwords, credit card numbers, private messages Anyone on the same network (coffee shop Wi-Fi, ISP, attacker with packet sniffer) can read all data All data encrypted — interceptor sees only ciphertext
Integrity Ensures data is not modified between sender and receiver Attacker can silently modify web page content in transit — inject ads, malware, or false information HMAC attached to each record; any modification detected and connection terminated
Authentication Proves you are connected to the legitimate server, not an impersonator Attacker can impersonate example.com with no way for the browser to detect it Certificate signed by trusted CA proves server identity; browser rejects invalid/mismatched certificates

10. Attacks Against HTTP and HTTPS

Attack Target Method Mitigation
Passive Eavesdropping HTTP only Attacker captures unencrypted HTTP traffic on shared network (Wi-Fi sniffing, ARP poisoning / Wireshark capture) Use HTTPS — encryption makes intercepted traffic unreadable
Man-in-the-Middle (MitM) HTTP + HTTP Attacker positions between client and server, relaying and optionally modifying all traffic HTTPS with certificate validation — client verifies server identity; MitM cannot present a valid cert for the target domain
SSL Stripping HTTPS downgrade MitM intercepts initial HTTP request before redirect to HTTPS, maintains HTTP to victim while connecting HTTPS to server — victim never knows HTTPS was available HSTS (HTTP Strict Transport Security) — browser remembers that the site requires HTTPS and refuses HTTP connections; HSTS Preload list ensures even first visit is HTTPS
Certificate Spoofing HTTPS Attacker presents a forged or rogue certificate for a domain CA validation chain — browser only accepts certificates signed by trusted root CAs; Certificate Transparency (CT) logs detect rogue issuance
POODLE SSL 3.0 Forces downgrade to SSL 3.0, exploits padding oracle vulnerability Disable SSL 3.0 entirely on all servers
BEAST TLS 1.0 Browser Exploit Against SSL/TLS — exploits CBC mode in TLS 1.0 Upgrade to TLS 1.2/1.3; disable TLS 1.0
Expired/Invalid Certificate HTTPS Server presents expired or hostname-mismatched certificate Monitor certificate expiry; automate renewal (Let's Encrypt + certbot); use wildcard/SAN certs for subdomains

11. HSTS — HTTP Strict Transport Security

HSTS is a web security policy mechanism that forces browsers to interact with a server only over HTTPS, even if the user types http:// or clicks an HTTP link. The server sends an HTTP response header:

  Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  │                           │               │                   │
  │                           │               │                   └─ Submit for HSTS preload list
  │                           │               └─ Apply to all subdomains
  │                           └─ Browser remembers HSTS for 1 year (31536000 seconds)
  └─ HSTS header name

Once a browser has received this header, for the max-age duration it will:

  • Automatically rewrite http://example.com to https://example.com before sending any request
  • Refuse to connect if the TLS certificate is invalid — no option to "proceed anyway" (unlike the normal browser certificate warning)
  • Block SSL stripping attacks because the first request never goes over HTTP at all
The first-visit problem and HSTS Preload: HSTS only works after the browser has visited the site once and received the header. The very first visit is still vulnerable to SSL stripping. The HSTS Preload list (maintained at hstspreload.org and built into Chrome, Firefox, Safari, Edge) solves this by hardcoding domains that always require HTTPS — even on the very first visit.

12. HTTP/2 and Performance

HTTP/2 (RFC 7540) is a major revision of HTTP designed to improve performance over HTTP/1.1. While technically usable over plaintext (h2c), every major browser requires HTTPS (h2) to use HTTP/2. This makes HTTPS a prerequisite for modern web performance.

Feature HTTP/1.1 HTTP/2
Multiplexing One request per TCP connection (or pipelining — poor support) Multiple requests and responses simultaneously over a single TCP connection
Header compression Headers sent as plaintext, repeated on every request HPACK compression — headers compressed and cached; dramatically reduces overhead
Server push Client must request every resource Server can proactively push resources (CSS, JS) before client requests them
Binary framing Text-based protocol Binary framing — more efficient parsing, less error-prone
TLS requirement Optional Mandatory for browser support (h2 requires TLS)
TLS handshake overhead: The TLS handshake adds latency to the first connection (1–2 additional round trips for TLS 1.2; 1 for TLS 1.3). Session resumption (TLS session tickets) eliminates the handshake cost for reconnections. On modern hardware and networks, TLS adds <1 ms of CPU overhead per request — the performance argument against HTTPS is obsolete.

13. Implementing HTTPS — Step-by-Step

  1. Obtain a certificate from a trusted CA: For free certificates, use Let's Encrypt (automated, DV certificates, 90-day validity, auto-renewable via certbot). For paid certificates with OV/EV validation, use DigiCert, Sectigo, GlobalSign, or similar. Internal-only servers can use a private/internal CA.
  2. Install the certificate on the web server:
      # Apache — in VirtualHost block:
      SSLEngine on
      SSLCertificateFile     /etc/ssl/certs/example.com.crt
      SSLCertificateKeyFile  /etc/ssl/private/example.com.key
      SSLCertificateChainFile /etc/ssl/certs/intermediate.crt
    
      # Nginx:
      server {
          listen 443 ssl;
          ssl_certificate     /etc/nginx/ssl/example.com.crt;
          ssl_certificate_key /etc/nginx/ssl/example.com.key;
      }
  3. Redirect all HTTP traffic to HTTPS:
      # Apache — in port 80 VirtualHost:
      RewriteEngine On
      RewriteCond %{HTTPS} off
      RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    
      # Nginx:
      server {
          listen 80;
          server_name example.com;
          return 301 https://$host$request_uri;
      }
  4. Enable HSTS to prevent SSL stripping attacks:
      # Apache:
      Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
    
      # Nginx:
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  5. Configure strong cipher suites and disable legacy protocols:
      # Nginx — recommended TLS configuration:
      ssl_protocols TLSv1.2 TLSv1.3;           # Disable SSL 2/3, TLS 1.0/1.1
      ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:...;
      ssl_prefer_server_ciphers off;            # Let client choose (TLS 1.3)
  6. Automate certificate renewal (Let's Encrypt certificates expire every 90 days):
      # Certbot — runs renewal check twice daily via cron/systemd:
      0 0,12 * * * root certbot renew --quiet

14. Key Points & Exam Tips

  • HTTP: Port 80, plaintext, no authentication, no encryption, no integrity protection.
  • HTTPS: Port 443, encrypted via TLS, server authentication via digital certificate, data integrity via HMAC.
  • HTTP methods: GET (retrieve), POST (submit), PUT (replace), DELETE (remove), HEAD (headers only). GET parameters appear in URL — never use for passwords.
  • HTTP status codes: 2xx = success, 3xx = redirect, 4xx = client error (404 Not Found, 401 Unauthorized), 5xx = server error.
  • TLS versions: SSL 2/3 and TLS 1.0/1.1 are deprecated and must be disabled. TLS 1.2 is the minimum; TLS 1.3 is preferred.
  • TLS handshake: ClientHello → ServerHello → Certificate → key exchange → session keys derived → encrypted channel established.
  • TLS 1.3 advantages: 1-RTT (faster), mandatory forward secrecy (ECDHE), removed legacy ciphers.
  • Certificate chain: Root CA → Intermediate CA → Server certificate. Browser validates the full chain to a trusted root.
  • Certificate types: DV (domain only), OV (organisation verified), EV (extended validation), Wildcard (*.domain.com), SAN (multiple domains).
  • HSTS forces browser to always use HTTPS; prevents SSL stripping; max-age controls how long; HSTS Preload solves the first-visit problem.
  • MitM attack over HTTP: attacker intercepts and reads/modifies all traffic. HTTPS with certificate validation defeats MitM.
  • HTTP/2 requires TLS in all major browsers — HTTPS is a prerequisite for modern web performance.
  • HTTP 301 redirect sends browsers from HTTP to HTTPS permanently.
  • Let's Encrypt provides free, automated DV certificates — widely used for most HTTPS deployments.

Related pages: DNS Purpose | DNS Lookup | DNS Configuration | Firewalls | OSI Model | Wireshark

15. HTTP vs HTTPS Quiz

1. A developer is building a login form and asks whether to use HTTP GET or POST to submit username and password credentials. Which method is more appropriate for transmitting credentials, and why does the choice of method not guarantee security on its own?

Correct answer is C. POST is always preferred for sensitive data like credentials for a specific reason: GET parameters appear in the URL (e.g., ?user=alice&pass=secret) which is logged in browser history, the server's access log, any proxy logs, and potentially Referer headers sent to third parties. POST body parameters do not appear in the URL. However — and this is the critical nuance — POST over plain HTTP is still completely unencrypted. Any attacker sniffing the traffic can read the POST body just as easily as a GET URL. POST prevents accidental credential exposure via logs; only HTTPS prevents credential theft via network interception. The correct answer is both: use POST AND HTTPS.

2. A user visits a coffee shop and connects to the free Wi-Fi. They then browse a website that uses plain HTTP. An attacker on the same Wi-Fi network uses a packet sniffer. What can the attacker see, and what would prevent this?

Correct answer is D. HTTP provides zero encryption. On a shared network (Wi-Fi, hotel, corporate LAN), anyone with a packet sniffer (Wireshark, tcpdump) can capture all TCP traffic and read every byte of HTTP requests and responses in plaintext. This includes: the full URL path (not just the domain), HTTP headers (cookies, session tokens, user agent), any POST body (login credentials, form data), and the full response (web page HTML, images). HTTPS wraps all HTTP in TLS encryption — the attacker still sees TCP packets but the payload is encrypted. They can see that a connection was made to a particular IP/hostname (from DNS/SNI) but cannot read the URL path, headers, or body content.

3. During the TLS 1.2 handshake, the browser receives the server's certificate. The certificate is signed by an Intermediate CA, which is signed by a Root CA. What validation steps must the browser perform before establishing the secure connection?

Correct answer is B. The browser performs a multi-step certificate validation chain before accepting the certificate. (1) Chain validation: the Intermediate CA's certificate must be signed by a Root CA that is in the browser's/OS's trusted root store. Without a trusted root at the top of the chain, the certificate is rejected ("certificate not trusted"). (2) Expiry: the current date must be between the certificate's notBefore and notAfter dates. (3) Hostname matching: the hostname the browser is connecting to must match the certificate's Common Name (CN) or Subject Alternative Name (SAN) field — a mismatch triggers a "certificate hostname mismatch" error. (4) Revocation: OCSP (Online Certificate Status Protocol) or CRL (Certificate Revocation List) checked to confirm the certificate has not been revoked by the CA. All four checks must pass for the padlock to be shown.

4. An attacker positions themselves between a user and a bank's website. The attacker intercepts the user's initial HTTP request to http://bank.com, establishes their own HTTPS connection to bank.com, and relays a plain HTTP version to the user — who never sees any HTTPS. What attack is this and what server-side mechanism defeats it?

Correct answer is A. This is an SSL stripping attack, first demonstrated by Moxie Marlinspike in 2009. The key insight is that the victim typed http:// (or just clicked a link) — their browser never attempted HTTPS in the first place. The attacker intercepts the HTTP request before the server's 301 redirect to HTTPS, maintains a plain HTTP connection to the victim, and opens their own HTTPS session to the real bank. The victim sees an unsecured connection but may not notice. HSTS defeats this: once a browser has received the Strict-Transport-Security header from a site, it will internally rewrite any http:// request for that domain to https:// before any network request is made — the attacker never gets the initial HTTP request to intercept. HSTS Preload extends this protection to the very first visit.

5. A web server is configured to support TLS 1.0, TLS 1.1, TLS 1.2, and TLS 1.3. A security audit flags TLS 1.0 and 1.1 as a compliance failure. Why are these versions considered insecure and what is the minimum version that should be supported?

Correct answer is C. TLS 1.0 (1999) was vulnerable to the BEAST (Browser Exploit Against SSL/TLS) attack which exploited CBC mode in TLS 1.0's block cipher implementation. TLS 1.1 (2006) partially addressed this but retained other weaknesses including support for weak cipher suites (MD5, SHA-1 based). Both were officially deprecated by RFC 8996 in March 2021. All major browsers (Chrome 84, Firefox 78, Safari 14, Edge 84) removed TLS 1.0 and 1.1 support in 2020. PCI-DSS (Payment Card Industry Data Security Standard) has required disabling TLS 1.0 since June 2018 and TLS 1.1 since June 2020. The minimum compliant version is TLS 1.2 with strong cipher suites; TLS 1.3 is the recommended target.

6. A company runs 15 subdomains (api.example.com, mail.example.com, shop.example.com, etc.) and wants a single certificate to cover all of them. They also want the certificate to include example.com itself and example.org (a different domain). Which certificate type(s) should they use?

Correct answer is B. Two certificate types address these requirements. A Wildcard certificate (*.example.com) covers all immediate subdomains of example.com — api.example.com, mail.example.com, shop.example.com, and any other *.example.com hostname — with a single certificate. However, wildcard certificates cover only one level of subdomains (*.example.com does NOT cover sub.api.example.com), and do not cover different domain names like example.org. A SAN (Subject Alternative Name) / Multi-Domain certificate allows multiple distinct hostnames and domains to be listed in one certificate — example.com, example.org, *.example.com can all be in a single SAN certificate. Modern certificates (including Let's Encrypt) commonly combine wildcard and SAN to provide maximum coverage.

7. A web server sends the following header in its HTTPS response:
Strict-Transport-Security: max-age=63072000; includeSubDomains
Six months later, the admin accidentally removes the HTTPS redirect and adds back port 80 HTTP. A returning user's browser tries to load the site via http://. What happens?

Correct answer is D. This illustrates both the power and a potential operational challenge of HSTS. The max-age=63072000 (two years) means the browser caches the HSTS policy for two years from the last time it received the header. During that period, the browser will automatically upgrade any http:// request for this domain to https:// internally — before any network packet is sent. If the server no longer responds on HTTPS (cert expired, HTTPS disabled), the browser will show a hard error with no "proceed anyway" option. This is intentional security behaviour — HSTS refuses to allow fallback to insecure HTTP. The admin must restore HTTPS on the server. The includeSubDomains means this behaviour applies to all subdomains too.

8. Why do all major browsers require TLS for HTTP/2 (h2) connections, even though the HTTP/2 specification technically allows plaintext (h2c)?

Correct answer is A. The HTTP/2 specification (RFC 7540) does define an unencrypted cleartext mode called h2c. However, every major browser (Chrome, Firefox, Safari, Edge) explicitly chose not to implement h2c — they only support HTTP/2 over TLS (h2). This was a deliberate industry policy decision, not a technical requirement of the protocol. The reasoning: by linking HTTP/2's performance benefits (multiplexing, header compression, server push, reduced latency) to TLS, browser vendors created a powerful commercial incentive for web servers to deploy HTTPS. HTTP/2 is approximately 2–10× faster than HTTP/1.1 for typical web pages. Webmasters who want this performance gain must deploy HTTPS. This policy decision accelerated the HTTPS transition from roughly 50% of web pages in 2016 to over 90% by 2023.

9. A security engineer tests a web application and discovers that submitting a login form over HTTPS causes the session cookie to be set without the Secure flag. The site also still responds on port 80 HTTP. What risk does this create?

Correct answer is C. The Secure cookie flag instructs the browser to only send the cookie over HTTPS connections — never over HTTP. Without this flag, even though the cookie was issued over HTTPS, the browser will include it in any HTTP request to the same domain. Since the site still responds on port 80, an attacker performing a MitM or SSL stripping attack can trigger an HTTP request (through an injected link, image, or resource reference on an HTTP page) to the same domain. The browser sends the session cookie in plaintext over HTTP. The attacker captures it and uses it to impersonate the authenticated user — a session hijacking attack. The fix: always set the Secure flag on all session cookies, disable port 80 HTTP (or redirect with HSTS), and add the HttpOnly flag to prevent JavaScript access to the cookie.

10. A user browses to https://bank.com and their browser shows a certificate error: "Your connection is not private — NET::ERR_CERT_ AUTHORITY_INVALID." The certificate was issued by the company's own internal CA. What is the cause and how should it be resolved?

Correct answer is B. Certificate validation requires the browser to trace the certificate chain back to a Root CA that is in its trusted root store. The browser/OS ships with a pre-installed list of trusted public CAs (DigiCert, Let's Encrypt, GlobalSign, etc.). A privately operated internal CA is not on this list. When a server presents a certificate signed by an internal CA, the browser cannot build a trusted chain to a known root — hence "authority invalid." The error is not about the certificate being wrong; it is about the issuing CA being unknown to the browser. The solution for internal deployments: export the internal CA's root certificate and distribute it to all internal clients. On Windows domains, this is done via Group Policy (Computer Configuration → Windows Settings → Security Settings → Public Key Policies → Trusted Root Certification Authorities). Once installed, the browser trusts any certificate signed by that CA.

← Back to Home