On this page

0260. Plain HTTP for loopback and allowlisted hosts

Context

Local registries and agent tools need plain HTTP without silently trusting LANs or weakening HTTPS. Builds on ADR-0163, ADR-0166, ADR-0247 and ADR-0252.

Decision

  1. Allow http:// without config for exact loopback hosts 127.0.0.1, localhost and (plugin only) [::1]. Any port; default 80.
  2. Other hosts require explicit opt-in: plugin Plain.hosts, or user sources.toml [[registry]] roots / [[mirror]].to roots. Never automatically trust RFC1918. Warn off loopback, except the library exposes loopback for apps.
  3. The capability-free plugin uses caller-supplied Conn/Net and native Net.connect, not curl. Registry curl uses --proto =http --proto-redir =http, --noproxy '*', no proxy environment and zero redirects.
  4. Bearer tokens are permitted only on loopback plain HTTP. Configuring a token for another HTTP authority is an error; never send it. Never follow plain-HTTP redirects or read http_proxy. ADR-0252 HTTPS proxy rules remain unchanged.
  5. DNS-in-connect (named LAN hosts validate but cannot connect), registry IPv6, chunked responses, keep-alive and TLS are out of scope. This does not choose TLS, runner isolation, or any ADR-0204–0207 item.

Alternatives considered

Consequences

M-HTTP.8 adds pure wire encoding/parsing; M-HTTP.9 will add the native client; M15.5 P1b will add registry policy. Existing HTTPS client behavior is unchanged. Applications must explicitly acknowledge non-loopback plaintext risk.

Open questions

  1. Allowlist host or authority? Default: exact authority as written, including port, consistent with allowed_url.
  2. IPv6 loopback? Default: plugin [::1] yes; registry follows up (host_valid).
  3. Timeout knob? Default: none, use native connection deadline. Verify in P1a2: if Conn.timeout exists, use 30000 ms; otherwise wait for a setter.
  4. Redirects? Default: plugin returns 30x as Reply, never follows; registry refuses via curl max-redirs 0.
  5. Chunked? Default: reject; track with streaming responses in PLAN-http Later.
  6. Token diagnostic? Default: E1087, not E1084 (unavailable). E1085 is used by RG4.1c (release tags).
  7. Project non-loopback HTTP roots? Default: no, E1083; user-machine opt-in, like [[auth]].