What is HTTPS?

HTTP protected by TLS. It encrypts exchanges, detects tampering and authenticates the server with a server certificate. URLs start with https:// and the default port number is 443. Requests and responses have the same form as in HTTP, with a TLS layer underneath.

Japanese name: HTTPS

HTTPS appears in 12 practice questions across 6 topics, including Computer Networking Basics, Web Technology Basics, Information Security Basics.

Field: Web Technology Basics

How a connection is made

The browser first opens a TCP connection to the server (QUIC in HTTP/3) and then performs a TLS handshake. The browser sends the cipher suites it supports, a value for key exchange and the name of the server it wants (SNI), and the server returns its certificate and its own key-exchange value. Using a key exchange such as ECDHE, the two derive a fresh shared key for each connection, and the browser verifies the server's certificate. The HTTP requests and responses that follow are encrypted and protected against tampering with a symmetric cipher such as AES-GCM. With TLS 1.3 the handshake takes one round trip.

Checking the server with its certificate

A server certificate is a domain name and public key vouched for by a certificate authority (CA) with a digital signature. The browser checks that the certificate chains through signatures to a trusted root CA, that it is within its validity period, that it matches the host name in the URL and that it has not been revoked. This prevents man-in-the-middle attacks in which someone intercepts the connection and poses as the real server. If the checks fail, the browser shows a warning and stops the connection.

What it protects and what it does not

HTTPS protects page content, the path and query of the URL, headers and cookies from eavesdropping and tampering along the way. The server's IP address and the volume and timing of traffic remain visible, and the domain name can often be learned from DNS queries or the SNI. HTTPS also protects only the channel; it does not show that the site's operator can be trusted, because fake sites can obtain certificates and use HTTPS too. It is used together with HSTS, which prevents downgrades to HTTP, and the Secure cookie attribute, which sends cookies only over HTTPS.

Try it: questions about HTTPS

In a Kubernetes cluster, HTTPS requests arriving for one host name should be routed to the api Service if the path begins with /api, and to the web Service otherwise. Which of the following resources is suitable for defining this routing rule?

  1. AIngress
  2. BReplicaSet
  3. CA Service of type: ClusterIP
Show answer and explanation

Answer: A. Ingress

An Ingress is a resource that defines rules for routing HTTP and HTTPS requests from outside the cluster to Services according to the host name and URL path, and TLS termination can also be configured there. The component that actually receives and routes the requests is an Ingress controller installed in the cluster (which acts as a reverse proxy). A Service of type: ClusterIP is an endpoint reachable only from inside the cluster and has no path-based routing. A ReplicaSet keeps the number of Pods and has nothing to do with routing traffic.

A client makes a new HTTPS connection (TLS 1.3 over TCP) to a web server with a round-trip time (RTT) of 100 ms. Roughly how long does it take until the response to the first request starts to arrive? Assume DNS resolution is already done, and ignore server processing time and data transfer time.

  1. AAbout 100 ms
  2. BAbout 300 ms
  3. CAbout 200 ms
Show answer and explanation

Answer: B. About 300 ms

First, the TCP three-way handshake takes one round trip (the client can send its first TLS message together with the final ACK). Next, the TLS 1.3 handshake takes one round trip, and then the HTTP request and response take one more, for three round trips in total: 3 × 100 = 300 ms. With TLS 1.2 the key exchange takes two round trips, giving four round trips, or 400 ms. This waiting time depends on the number of RTTs, which is set by distance, so adding link bandwidth does not shorten it. QUIC, used by HTTP/3, combines the transport and cryptographic handshakes into one round trip and also offers a way to send data in the first flight when reconnecting (0-RTT).

FAQ

What is the difference between HTTP and HTTPS?

HTTPS encrypts HTTP exchanges with TLS and adds tamper detection and server authentication. Requests and responses have the same form, and the default ports are 80 for HTTP and 443 for HTTPS. With plain HTTP, devices along the path can read or alter the content.

Is a site safe just because it uses HTTPS?

HTTPS confirms that the traffic is not read or altered in transit and that you are connected to a server for that domain name. It does not guarantee that the site itself is genuine or harmless. Phishing sites can use HTTPS too, so check the domain name carefully.

Does HTTPS use public-key or symmetric encryption?

Both, for different jobs. The handshake uses public-key techniques for key exchange and certificate-based authentication, and the actual data is encrypted with a fast symmetric cipher using the keys created there.

HTTPS in the explanations

Questions that mention HTTPS (12)

  1. In a Kubernetes cluster, HTTPS requests arriving for one host name should be routed to the api Service if the path begins with /api, and to the web Service otherwise. Which of the following resources is suitable for defining this routing rule?
  2. A client makes a new HTTPS connection (TLS 1.3 over TCP) to a web server with a round-trip time (RTT) of 100 ms. Roughly how long does it take until the response to the first request starts to arrive? Assume DNS resolution is already done, and ignore server processing time and data transfer time.
  3. Which of the following does HTTPS (HTTP protected by TLS) protect?
  4. Host A (192.168.1.10), inside a router performing NAPT whose outside global address is 198.51.100.7, connects from source port 50000 to port 443 on web server 203.0.113.5. The router translates the source to port 61000 on 198.51.100.7. What is the destination of the response packets the web server sends back?
  5. Which correctly pairs protocols with the standard port numbers their servers use?
  6. Which of the following correctly describes the cookie set by the header above?
  7. Which of the following correctly describes a Service Worker?
  8. Which of the following correctly describes a reverse proxy?
  9. A bulletin-board web application had a vulnerability in which scripts contained in text posted by users were executed in other visitors' browsers. Which combination correctly gives the name of this vulnerability and its fundamental countermeasure?
  10. If a web application keeps using the same session ID before and after login, an attacker may get the user to use a session ID the attacker prepared in advance and then, after the user logs in, impersonate the user with that ID. What is the most appropriate countermeasure against this attack?
  11. Let 1 GiB = 2³⁰ bytes and 1 EiB = 2⁶⁰ bytes. A block cipher with a 64-bit block (such as 3DES) is used in CBC mode to encrypt a large amount of data under one key. Treating the ciphertext blocks as random 64-bit values, which of the following is the approximate amount of data at which, by the birthday paradox, the probability that a pair of identical ciphertext blocks appears can no longer be ignored?
  12. Which of the following correctly describes a WAF (web application firewall)?

Books on Web Technology Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

HTTP (Hypertext Transfer Protocol) URL (Uniform Resource Locator) TLS Cookie (HTTP cookie) IP address Cross-site scripting (XSS) Reverse proxy DNS (Domain Name System) Port number Kubernetes

Back to the glossary