skip to content

In a banking app, how should the cleartext policy handle a partner's plain-HTTP feed and a plain-HTTP test server?

level: juniorimportance: should knowfreq 44%

answer

  1. integrity, not only secrecy
  2. the default is already TLS-only
  3. fix the feed at its source
  4. debug trust never ships
  5. the policy lives in every installed build

basics

~20 s

Keep the app TLS-only, as current platform defaults already are. Move the partner feed to HTTPS or relay it through the bank's own HTTPS API, and give the test server a debug-only exception that the release build never carries.

solid answer

~40 s

Plain HTTP can be read and rewritten by anyone on the path, so even a harmless-looking promotions feed could arrive carrying a phishing link or a swapped support number. Both mobile platforms already default to TLS-only for apps built against current releases, so the job is to keep it that way. The partner should serve HTTPS, or the bank's backend fetches the feed and serves it over its own HTTPS API. If an exception is truly unavoidable, it names that one domain in the app's network-security policy; it is never a global opt-out. The staging server gets trust or an exception that exists only in debug builds, so nothing loosened reaches customers. Whatever the release build declares stays on phones for years, because the policy changes only with an app update.

go deeper

for a junior

Recall that plain HTTP can be read and changed on the path, and that current mobile platforms block it by default unless the app declares an exception.

for a middle

Explain the options in order: HTTPS at the source, a relay through the bank's API, then a one-domain exception; and keep test trust in debug builds only.

for a senior

Show that the policy ships in a binary nobody can recall, check which clients bypass the platform stack, and add a release check that fails on any loosened rule.

for a principal

Set one transport rule for every team: TLS-only, exceptions reviewed and owned, debug trust isolated, and a build gate, because a loosened release stays installed for years.

## Why plain HTTP is unacceptable even for public content **Cleartext** traffic is plain HTTP with no TLS. Anyone on the path between the phone and the server can read it and, more importantly, *change* it: a public Wi-Fi hotspot, a compromised home router, an access point named after the café the customer is sitting in. For a banking app, secrecy is only half of the problem. A promotions feed that looks harmless can be rewritten in transit to carry a phishing link, a fake support phone number or a script for a web view. **Integrity** matters as much as confidentiality, and only TLS gives the app both. So the starting rule is **TLS-only**, and every exception has to argue its way in. ## What the platforms already do by default Both native platforms now start from TLS-only, so a banking app's work is mostly to avoid undoing that default. | | One platform | The other platform | |---|---|---| | Default for apps built against current releases | cleartext disabled; specific domains can be opted back in | HTTPS required for the standard URL-loading stack unless the app declares an exception | | Where exceptions live | the app's network-security policy, per domain or app-wide | the app's transport-security settings, per domain, for web content, or app-wide | | What the vendor says about a global opt-out | an insecure configuration to avoid whenever possible | loosening the defaults reduces the app's security | Two caveats every engineer on either platform, or on a cross-platform framework, should know: - The default governs the platform's **standard networking stack**. A low-level socket, a bundled third-party networking library or a framework's own HTTP client can bypass it, so check what each dependency actually uses. - **Web views** have their own rule on one platform: a separate exception allows insecure loads in web content only. A banking app should not need it. ## The partner feed: fix it at the source Options, best first: 1. **HTTPS from the partner.** Often the cheapest fix is asking; most content hosts already offer it. 2. **Relay through the bank's backend.** The backend fetches the feed, checks and trims it, and serves it over the bank's own HTTPS API. The app then talks only to hosts the bank controls, and the bank can strip anything that should never reach a banking screen. 3. **A narrow per-domain exception** as a last resort: one host, no subdomains unless required, and everything from it treated as untrusted (no links into payment flows, no scripts). What never belongs here is a **global opt-out** "to unblock one partner". It opens every host, including URLs the server sends later. The cleartext rule exists partly to catch exactly that: one platform's documentation says opting out of cleartext helps prevent accidental regressions when URLs come from external sources such as backend servers. An `http://` link in a server response stays blocked only while the default holds. ## The test server: keep the exception out of release builds - Put HTTPS on the staging server with a **test certificate authority**, and trust that authority only in debug builds. One platform's policy supports this directly: trust declared for debuggable builds only, and app stores do not accept debuggable builds. - If plain HTTP is genuinely needed, make the exception part of the **debug build configuration**, not code that checks an "is staging" flag at runtime. A runtime flag ships inside the release binary, where anyone patching the app can flip it. - Add a release check that fails the build when the release policy contains a cleartext exception or debug-only trust. ## Why this decision lives for years The policy is compiled into the app. A website can fix a bad response header in minutes; a banking app's release build stays installed until each user updates, and in this scenario builds two years old are still in use. A global opt-out that slips into one release is therefore an exposure the bank cannot recall: every phone carrying that build stays loosened for as long as it is installed. That is the mobile-specific reason to treat the cleartext policy as a reviewed file with an owner, not a build tweak. | Choice | Risk to customers | Lasts how long | |---|---|---| | Partner on HTTPS | none added | n/a | | Relay via the bank's API | none added; one more backend job | n/a | | One-domain exception | that host's content can be tampered with | every installed build that declares it | | Global opt-out | every cleartext URL, including server-sent ones | every installed build that declares it | ## What a strong answer sounds like State the default, refuse the global switch, offer the relay, isolate debug trust, and point out that the policy outlives the release. The candidate who adds that the default covers only the standard networking stack, and checks the app's other clients, has shown they have shipped one.

  • Every URL in the banking app's code is already https://. Does the cleartext policy still matter?
    Yes. URLs also arrive at runtime: a server response, a deep link, a partner payload. If one of them is `http://`, the TLS-only default refuses it instead of silently sending a request in the clear. One platform documents this as the purpose of opting out of cleartext: it prevents regressions when URLs come from external sources such as backend servers.
  • The marketing team wants to open partner pages inside a web view in the banking app. What changes?
    Web content can carry its own exception on one platform, so the TLS-only rule must be checked for the web view too, and the page itself is untrusted content. Prefer opening partner pages in the system browser, outside the banking session, and keep the web view for the bank's own HTTPS pages.

  • Cleartext is fine for content that is public anyway, like promotions.
  • Turn cleartext on globally to unblock one partner domain.
  • Removing debug exceptions by hand before each release is a reliable safeguard.
  • The platform default covers every socket and library the app uses.
  • Once every URL in the code is https, the cleartext policy no longer matters.