HTTP and HTTPS
HTTP (Hypertext Transfer Protocol) is the set of rules a client and a server use to exchange messages on the web. The client sends a request, such as GET /orders/1042, and the server sends back a response, such as 200 OK with the order as JSON. Every page, image, API call and form submission you test travels as such a request and response.
HTTPS is the same HTTP sent inside a TLS connection. TLS encrypts the messages, detects any change made to them on the way, and uses the server's certificate to prove that the client is talking to the real shop.example.com. The lesson on how browsers work showed where this happens during a page load; this lesson explains what each protocol promises and what it does not.
Why it matters
Many failures that look like application bugs are HTTP or HTTPS behaviour: users signed out at random because their next request reached a different server, a mobile app that cannot connect while the browser can, a checkout that stops working the day a certificate expires, a form that sends card details over plain HTTP. A tester who knows the model can name the cause and the team that owns it.
For users, HTTPS protects passwords, session cookies and personal data from anyone on the network path, such as the operator of a public Wi-Fi. For testers, HTTP is the layer every web and API test sits on.
Client and server: the request–response exchange
In HTTP the client always speaks first. It sends a request: a method such as GET or POST, a target such as /orders/1042, header fields and sometimes a body. The server waits for requests and answers each one with a response: a status code, header fields and usually a body.
Client and server are roles, not machines. A browser, a mobile app, curl and your automated tests are clients; so is a checkout service when it calls a payment API, although it is a server for its own users. Between them there are often intermediaries — proxies, load balancers, API gateways and CDNs (content delivery networks) — that forward a request or answer it from a cache. RFC 9110 calls the server that owns the resource the origin server, and the response you see was not always produced by it.
GET /orders/1042 HTTP/1.1
Host: shop.example.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{"id": 1042, "status": "shipped", "items": 3}Stateless: every request stands alone
RFC 9110 defines HTTP as stateless: each request can be understood in isolation, and nothing in the protocol links your third request to your first. This is what lets a site spread requests over many servers behind a load balancer.
Applications that need continuity — a signed-in user, a cart, a multi-step form — build it on top: the client sends an identifier with every request, usually a cookie or an Authorization header, and the server looks up the matching state in its own storage. For a tester this turns into concrete test ideas:
- Refresh, a shared link and a second tab each send a new request, linked to the earlier steps only by what it carries, such as a cookie. Open step 3 of a checkout directly in a private window: the application should send you to sign-in or rebuild the step, not crash or show another user's data.
- If a server instance keeps session data in its own memory, the next request may reach an instance that has never seen you, and users lose their session or cart at random. Repeat the flow many times and ask how sessions are stored.
- The server must check on every request who sends it and what that user may do; it cannot rely on an earlier request. In your test environment, replay a request from your test account without its cookie or token: the server must refuse it.
- The server cannot tell a double click from two real orders. Submit a form twice quickly and count the orders created; preventing duplicates is the application's job, not HTTP's.
HTTPS: the same HTTP inside TLS
An https:// address means the HTTP messages travel inside a TLS (Transport Layer Security) connection, on port 443 by default instead of 80. The messages do not change; TLS adds three guarantees: confidentiality (nobody on the path can read them), integrity (altered bytes are detected and the connection fails) and authentication of the server (it really is the host in the address). A client can prove its identity with its own certificate too, which some service-to-service APIs require; this is called mutual TLS.
Before the first HTTP byte the two sides run a TLS handshake. It relies on a key pair: a public key that anyone may see and a private key that only the server keeps. Data signed with the private key can be checked with the public key, so a valid signature proves that the signer holds the private key. In TLS 1.3 the handshake takes one round trip: the client proposes keys and names the host it wants; the server answers with its choices, its certificate and a signature proving it holds the certificate's private key; both derive the same session keys, and only then is the request sent, encrypted.
A certificate binds a public key to host names, listed in its Subject Alternative Name field, and is signed by a certificate authority (CA). The server sends its certificate plus the intermediate certificates that link it to a root CA the client already trusts, because that root is stored in the operating system or browser. The client checks:
- Name: the host must be listed. A wildcard
*.example.comcoversshop.example.combut neitherexample.comnorapi.shop.example.com. - Dates: the certificate must be within its validity period. An expired certificate stops every client at once.
- Chain: every link up to a trusted root must be present. A missing intermediate is a classic defect: a desktop browser may fill the gap by itself while apps and scripts fail.
- What stays visible: an observer on the path still sees the IP address, the timing and size of messages and usually the host name, but not the path, query, headers, cookies or body.
- What HTTPS does not cover: it protects data in transit only. The server sees everything, and broken access control or injection flaws work just as well over an encrypted connection.
Plain HTTP, port 80
- Browser client
- Server
shop.example.com
- 1 From Browser To Server: Opens a TCP connection
- 2 From Browser To Server: Sends the request as plain text Path, headers, cookies and body are readable on the way
GET /account HTTP/1.1 - 3 From Server To Browser: Sends the response as plain text reply Anyone on the path can also change it
HTTP/1.1 200 OK
Outcome: A Wi-Fi operator, a proxy or any router on the path can read and alter every byte. Fail
HTTPS: TLS 1.3, port 443
- Browser client
- Server
shop.example.com
- 1 From Browser To Server: Opens a TCP connection
- 2 From Browser To Server: Proposes keys and names the host Supported TLS versions, a key share and the host name
ClientHello - 3 From Server To Browser: Answers with its choices and its certificate reply Plus a signature proving it holds the private key
ServerHello … Certificate … Finished - 4 Browser internally: Checks the certificate Name covers the host, dates are valid, chain ends at a trusted root Pass
- 5 From Browser To Server: Completes the handshake Both sides now hold the same session keys
Finished - 6 From Browser To Server: Sends the same request, encrypted On the wire: unreadable TLS records
GET /account HTTP/1.1 - 7 From Server To Browser: Sends the response, encrypted reply
HTTP/1.1 200 OK
Outcome: An observer sees the IP address, timing, sizes and usually the host name, but not the path, headers, cookies or body. Pass
Simplified TLS 1.3 handshake. TLS 1.2 needs one more round trip before the request; with HTTP/3 the handshake runs inside QUIC over UDP, without a separate TCP connection.
HTTP versions in brief
All current HTTP versions share the semantics defined in RFC 9110: methods, status codes and header fields mean the same everywhere, so a 404 is a 404 in every version. What changes is how the messages are carried:
- HTTP/1.1: plain-text messages. A connection is reused for many requests but in practice carries one at a time, so browsers open several connections per host. HTTP/1.0, which opened a new connection per request by default, is rarely seen today.
- HTTP/2: the same messages in binary frames, with many requests sharing one connection at once (multiplexing) and compressed headers. Header names are always lowercase, and browsers use HTTP/2 only over HTTPS.
- HTTP/3: the same model over QUIC, a transport that runs on UDP with TLS 1.3 built in, so a lost packet delays only the request it belongs to. Browsers often learn that a server offers it from an
Alt-Svcresponse header, and fall back to HTTP/2 when a network blocks UDP. - For testing: add the Protocol column to the Network panel in DevTools; Chrome shows
http/1.1,h2orh3for each request. Behaviour should not depend on the version; when it does, suspect a proxy, a CDN setting or code that compares header names case-sensitively.
Worked example: an HTTPS check before a release
A shop is about to release a new sign-in page and an API for its mobile app. On staging, the tester checks https://staging.shop.example.com and https://api-staging.shop.example.com and records each result:
http://staging.shop.example.com/loginanswers301withLocation: https://staging.shop.example.com/login. Pass: plain HTTP only redirects.- HTTPS responses carry
Strict-Transport-Security: max-age=31536000. This HSTS header (RFC 6797) tells the browser to use only HTTPS for this host for a year; browsers ignore it when it arrives over plain HTTP. Pass. - The certificate covers
*.shop.example.com, chains to a trusted root and expires in 41 days. Not a defect, but the tester asks who renews it and how the team is warned. - The Console reports blocked mixed content: the page loads a chat widget script from an
http://address, and browsers block insecure scripts on HTTPS pages, so the chat button is missing. Defect. - The app cannot reach the API, although the same URL opens without a warning in a desktop browser.
curlfails, andopenssl s_client -connect api-staging.shop.example.com:443 -showcertslists only the server's own certificate: the intermediate is missing. Defect, reported with this evidence:
Title: api-staging sends an incomplete TLS chain; app and curl reject it
URL: https://api-staging.shop.example.com/v1/health
Clients: Android app 3.8.0 (staging build); curl on Ubuntu
curl: curl: (60) SSL certificate problem: unable to get local issuer certificate
Android: SSLHandshakeException: Trust anchor for certification path not found
Browser: the same URL opens without a warning in desktop Chrome
Chain: openssl s_client -showcerts shows 1 certificate (the server's own)
Expected: the server sends its certificate and the intermediate; clients connect
with certificate verification on
Note: not to be worked around with curl -k or a trust-all setting in the appTry it: Redirect Checker Try it: Security Header Analyzer Try it: API Endpoint Tester
Common mistakes
- Reading the padlock as "this site is secure". HTTPS protects data on the way; it says nothing about access control, input validation or what the server does with the data.
- Switching certificate verification off to make tests run (
curl -k,verify=False, a trust-all client) and leaving it off. The tests can then no longer catch the certificate defects users will hit, and the setting can slip into a release. - Checking HTTPS only in a desktop browser. Browsers can fill in a missing intermediate certificate; mobile apps, scripts and partner systems usually cannot.
- Testing a flow only by clicking through it in order. Refresh, deep links, a second tab and a replayed request are where state defects show.
- Checking only the
https://address you were given, and only on the day. Users also arrive throughhttp://and through the address with or withoutwww, and each must end on the HTTPS site; a certificate that is valid today stops every client on its expiry date.
The QA perspective
Run HTTP and HTTPS checks on every new environment and before every release that touches domains, certificates, load balancers, CDNs or proxies. The owners are rarely the feature developers: certificates, redirects and HSTS usually sit with the platform or DevOps team, session storage with the back-end developers. Put the HTTP-to-HTTPS redirect and the certificate expiry date into the smoke test, so both are checked after every deployment.
In a report, record the full URL with scheme and port, the client and its version (browser, app build, curl), the protocol (h2, h3), any VPN or proxy in the path, the time, and for certificates the host names, issuer chain and expiry date. Ask early: who renews the certificates and who is warned? Do all http:// addresses redirect? Where is session state kept when several server instances run? Do our test clients verify certificates the way real clients do?
Practice exercise
Review the HTTP and HTTPS setup of a payment page
Before a release you review the staging environment of a payment page and collect the six observations below. For each one decide whether it is a defect, a risk to raise or expected behaviour, name the idea from this lesson behind it, and write your next action.
Payment page: https://pay-staging.example.com/checkout
1. http://pay-staging.example.com/ returns 200 and shows the home page.
2. Certificate: SAN *.example.com and example.com, chain ends at a trusted root,
expires in 18 days.
3. The card form on /checkout posts to http://pay-staging.example.com/api/charge
4. After a refresh on step 2 of 3, the order summary is empty about half the time.
Two application servers run behind the load balancer.
5. DevTools Protocol column: h2 for the first request, h3 for most later ones.
6. The automated API test suite runs with certificate verification switched off.- Find the HTTP or HTTPS rule each observation touches.
- Classify it: defect, risk or expected behaviour.
- For defects and risks, write the next action: a bug report with its evidence, or a question and the person you would ask.
Show the model answer
1. Defect (HTTPS): plain HTTP serves the site instead of redirecting, so anyone who types the address starts unencrypted. Expected: 301 or 308 to the same path on https://. Report it with the request and the response.
2. Risk (certificates): the wildcard covers pay-staging.example.com and the chain is complete, but an expiry in 18 days needs an owner. Ask the platform team whether renewal is automatic and who is alerted.
3. Defect, Critical severity (HTTPS): card details would leave the page in plain text. Browsers warn about or block such a submission, but the form must post to https://. Report it at once.
4. Defect (statelessness): the summary is probably kept in one server's memory, and about half the refreshes reach the other server. Record how many of 20 refreshes failed, with times, and ask the back-end developers where session state is stored.
5. Expected behaviour (versions): browsers often start on HTTP/2 and switch to HTTP/3 after an Alt-Svc header. Report it only if behaviour differs between the two.
6. Risk in the test setup (certificates): the suite cannot detect an expired certificate or a broken chain. Ask for the staging CA to be trusted by the test clients and for verification to be switched back on.
Frequently asked questions
Is HTTPS a different protocol from HTTP?
No. HTTPS is HTTP carried inside TLS: the same methods, headers and status codes, with the https scheme and port 443 by default. Everything you learn about HTTP messages applies to both; HTTPS adds encryption, integrity and server authentication around them.
What is the difference between SSL and TLS?
SSL is the older protocol that TLS replaced. All SSL versions, and TLS 1.0 and 1.1 as well, are deprecated as insecure; a current server should accept only TLS 1.2 and 1.3. The name survives in phrases such as "SSL certificate", which means the same certificate used with TLS.
Do I need to test every HTTP version?
Usually not. The semantics are identical, so test the behaviour once and note the protocol in use. Add targeted checks where clients or networks differ, for example an office network that blocks UDP, where browsers fall back from HTTP/3 to HTTP/2.
Our staging server uses a self-signed certificate. How should we test?
Make the test devices and clients trust that certificate, or the internal CA that issued it, instead of switching verification off. Remember that this does not test the production chain: check the public certificate, its intermediates and its expiry in an environment that uses them.
References
- RFC 9110: HTTP SemanticsThe meaning of HTTP methods, header fields, status codes and content negotiation, independent of the wire version.
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3The TLS 1.3 handshake and record protocol that protect HTTPS traffic.
- RFC 6797: HTTP Strict Transport Security (HSTS)The Strict-Transport-Security header that tells browsers to use HTTPS only for a host.
- Overview of HTTP — MDNHow HTTP works: a stateless client–server protocol in which the client sends a request and the server answers with a response message.
Practise with Mutqan tools
Break a URL into protocol, host, port, path, query parameters, fragment and credentials.
See exactly what your client sends: method, headers, query, body, IP and TLS info.
Trace redirect chains (301/302/307/308) and see every hop, status and final URL.
Grade HTTP security headers (CSP, HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy, COOP/CORP) from pasted headers or a public URL.
Quickly check that an API endpoint is reachable: status, response time, size, content type and TLS.
Go deeper
Your progress on this topic
Not started
Mark the topic complete when you have studied it and done the exercise.
Sign in to track your progress
Mark topics complete, continue where you left off and unlock specialisation exams.