1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! HTTP client helpers reused across aube crates.
//!
//! The npm registry path is dominated by cold TCP+TLS handshakes,
//! per-origin DNS lookups, and per-request priority noise. Each helper
//! here addresses one of those costs without owning a `reqwest::Client`
//! itself — call sites keep their builders and pass them in.
//!
//! Killswitch convention follows aube-util: every optimization that
//! defaults ON ships an `AUBE_DISABLE_*` env var. Each killswitch is
//! named in the doc comment of the function reading it so cargo doc
//! enumerates them.
/// Add Mozilla's baked-in root bundle as extra trust roots while keeping
/// reqwest's rustls-platform-verifier OS trust store active.
///
/// reqwest 0.13 can merge extra roots with the platform verifier on Unix
/// (except Android) and Windows. On other targets, leave the builder alone
/// so client construction does not fail at runtime.
///
/// Compiled to a no-op when the `rustls` feature is not enabled — reqwest's
/// `Certificate`/`tls_certs_merge` APIs only exist with a TLS backend, and
/// this crate leaves that choice to the final binary (the aube binary selects
/// rustls via aube-registry's defaults).