Skip to content

X04 - Inspection compatibility

Purpose: Whether Go-based, Swift-based and Xcode clients in a macOS guest accept the per-VM CA when only the guest trusts it, which clients pin certificates, and which reread trust without a restart.

Brief: B18-tls-inspectionB18-tls-inspection: Do the guest's tools accept the inspection CA?No.

From X00-indexX00-index: SpikesThe open questions that must be answered by a throwaway prototype before work builds on them, in the order they are taken up.: do Go-based, Swift-based and Xcode clients accept a CA that only the guest trusts? Which clients pin certificates, and which reread trust without a restart, which sets the CA overlap (S09-07-ca-certificatesS09-07-ca-certificates: CA CertificatesThe profile and scope of each TLS inspection CA, the leaf certificates it signs, and its rotation., “Lifetimes”)? The CA has no name constraints since I39I39 (closed): S09-policy-credentials-audit: CA name constraints and rotation versus live policy changes- S07-egress-gateway "Approvals": "Policy changes take effect without restarting anything." - S09-policy-credentials-audit "Scope": the CA has name constraints for the inspected hostnames, and "when the inspected set…, so the issue’s checks of name constraints fall away. I18I18 (closed): X04-tls-inspection: Inspection compatibilityDo Go-based, Swift-based, and Xcode clients accept the name-constrained Wraith Box CA when it is trusted only in the guest? lists the clients: curl, Apple git, Homebrew git, gh, a Go program, URLSession, SwiftPM resolve through xcodebuild, Node, Python requests and pip, uv, Ruby, cargo, Java and Claude Code.

No. The CA works for every client that can be pointed at a CA file or a trust store variable. It doesn’t work for clients that read only the macOS system trust store, because wb-guestd can’t add it there. Each part, with the evidence in “Measurements”:

  1. The system trust store can’t be written without a user: verified refused. As root, from the guest daemon, with no user logged in:
    • security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain fails with “The authorization was denied since no user interaction was possible”. The rule behind it, com.apple.trust-settings.admin, is entitled or authenticate-admin.
    • security authorizationdb write com.apple.trust-settings.admin allow, the workaround CI machines use, is refused with NO (-60005), and so is is-root.
    • security trust-settings-import -d is refused the same way.
    • Trust for the project user’s own domain, set as that user, is refused the same way (rule entitled-session-owner-or-authenticate-session-owner).
    • profiles install answers “profiles tool no longer supports installs”.
    • A hand-written /Library/Security/Trust Settings/Admin.plist is ignored, also after trustd restarts. The host has admin trust settings too, and that folder is empty there. /private/var/protected/trustd/private, which root can’t list, is the likely place.
    • The certificate alone in the System keychain, without trust settings, isn’t trusted.
  2. URLSession clients need that store: verified. With every variable set, the Swift URLSession client fails with NSURLErrorDomain -1202, a SwiftPM binary target download fails with “The certificate for this server is invalid”, and xcodebuild’s requests to developer.apple.com fail. pip also reads that store by default (Apple’s message “certificate is not trusted”), but takes a variable.
  3. Every other client accepts the CA through a variable: verified. None of these clients pins. Which variable each one needs is in the table below. xcodebuild -resolvePackageDependencies and swift package resolve clone over git, so GIT_SSL_CAINFO covers them, with Xcode’s built-in source control and with -scmProvider system.
  4. Variables that replace the default roots need the public roots too: verified. SSL_CERT_FILE, GIT_SSL_CAINFO and the rest replace a client’s roots. With a file that held only the Wraith Box CA, curl, the Go program and Python failed on a pass-mode host, which shows its public certificate. With the guest’s public roots (/etc/ssl/cert.pem, 128 certificates) plus the CA, all three passed. Go on macOS reads SSL_CERT_FILE and then uses only that file.
  5. Only Python’s requests rereads trust: verified. Long-running processes started with a file that held one CA, made a request every 10 s, and the file then got the successor and the relay switched to it. The Go program, Node, Python’s urllib, Ruby and Java failed every request after the switch. requests passed, because it loads its CA file for every new session. Processes started after the file got the successor passed. Claude Code runs on Bun and couldn’t be run in a loop without an API key, so it wasn’t tested. Read at start, as Node and the others do, is the safe assumption. A 28-day overlap is therefore what bounds a process’s life, as S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded. states.
  6. Apple pins its own hosts: verified from the guest’s rules. No tested client pins. trustd’s pinning rules in the guest (/private/var/protected/trustd/pinningrules.sqlite3, 131 rules) pin Apple hosts that a development guest may contact: software update and the command line tools (swscan, swcdn, swdist, swdownload.apple.com), xcode-cdn.apple.com, mesu.apple.com, updates.cdn-apple.com, gdmf.apple.com, gs.apple.com and gsa.apple.com, and the Apple Account hosts (idmsa.apple.com). Four of them carry the rules’ transparentConnection flag (mesu.apple.com, updates.cdn-apple.com, gdmf.apple.com, gs.apple.com), which by its name applies the pin to every client of the system’s TLS. The others apply to Apple’s own clients that ask for that rule. So even with the CA in the system store, these hosts would refuse an inspected leaf. That is inferred: the spike couldn’t show it, because the CA never got in.
Client Version Variable that works Pins Rereads
Apple curl 8.7.1 (LibreSSL) SSL_CERT_FILE, CURL_CA_BUNDLE no new process
Homebrew curl 8.22.0 (OpenSSL 3.6.5) SSL_CERT_FILE, CURL_CA_BUNDLE no new process
Apple git 2.54.0 (Apple Git-157) GIT_SSL_CAINFO no new process
Homebrew git 2.56.0 GIT_SSL_CAINFO no new process
gh 2.102.0 SSL_CERT_FILE no new process
Go program, go mod download Go 1.27.1 SSL_CERT_FILE no no
Swift URLSession Swift 6.4 none can’t tell not tested
SwiftPM git (swift package resolve) Xcode 27.0 GIT_SSL_CAINFO no new process
SwiftPM binary target download Xcode 27.0 none can’t tell not tested
xcodebuild -resolvePackageDependencies Xcode 27.0 GIT_SSL_CAINFO for packages can’t tell new process
Node, npm 26.10.0 (Homebrew) NODE_EXTRA_CA_CERTS, and SSL_CERT_FILE in Homebrew’s build no no
Python urllib 3.14.8 (Homebrew) SSL_CERT_FILE no no
Python requests 2.34.2 REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE no yes
pip 26.2.1 REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE, PIP_CERT no new process
uv 0.12.23 SSL_CERT_FILE (also with UV_NATIVE_TLS) no new process
Ruby, gem 4.0.7 SSL_CERT_FILE no no
cargo 1.99.0 CARGO_HTTP_CAINFO no new process
Java OpenJDK 27 JAVA_TOOL_OPTIONS with a trust store file no no
Claude Code 2.1.293 NODE_EXTRA_CA_CERTS no not tested

“New process” means a command that runs and exits, so it reads trust each time it starts. “No” means a long-running process kept the trust it read at start.

The conditions under which inspection works:

  1. wb-guestd sets these variables for every project user’s processes: SSL_CERT_FILE, REQUESTS_CA_BUNDLE, GIT_SSL_CAINFO, CARGO_HTTP_CAINFO and JAVA_TOOL_OPTIONS point at files with the public roots and every current CA of the VM, and NODE_EXTRA_CA_CERTS at a file with only the CAs, since Node adds it to its own roots. CURL_CA_BUNDLE and PIP_CERT add nothing that these don’t cover. That is inferred from the runs with one variable at a time: these six never ran as a set.
  2. Java prints a line for JAVA_TOOL_OPTIONS. Every JVM writes “Picked up JAVA_TOOL_OPTIONS: …” to standard error at start. A tool that parses a JVM’s standard error sees it.
  3. URLSession clients reach only pass hosts until I185I185 (closed): Decide how wb-guestd makes a macOS guest trust the per-VM CAX04-tls-inspection (#18) found that a root daemon in a macOS 27 guest can't make the system trust a CA without a user to confirm: decides otherwise.
  4. Apple’s pinned hosts work only as pass hosts. Whether a user puts one in pass mode is the user’s choice, and each one is then a T01-allowed-channelsT01-allowed-channels: Data through allowed channelsData sent through allowed operations to allowed destinations, for example a push to an allowed repository that is public, or prompt content sent to the model provider. channel.

Host: Apple M2, 8 cores, 16 GB, macOS 27.0.1 (26A434), Xcode 27.0 (27A266a), no sudo. Guest: macOS 27.0.1 from the X17-image-buildX17-image-build: Unattended image buildCan a macOS guest installed from an Apple restore image get past Setup Assistant, with wb-guestd running as a root LaunchDaemon, without SSH, scripted clicks, or MDM? spike’s sealed image, 4 vCPU, 4 GiB, Apple’s NAT network. The guest got the Xcode command line tools from Apple, Xcode 27.0 from the host, Homebrew in a prefix the toolchain user owns (X20-shared-homebrewX20-shared-homebrew: Homebrew with more than one project userCan each project user in one guest get its declared Brewfile without a Homebrew prefix that another project user can write to (SEC08-proj-isolation)?), and Claude Code from its native installer, all before any inspection. The clients ran as a standard project user, from the guest daemon as root with sudo -u.

  • The relay. A Go program in the guest, as nobody, took the place of wb-proxyd. pf in the guest routed every other process’s TCP 443 to it, dropped UDP 443 so no client used QUIC, and refused IPv6 port 443. No client had proxy settings. The relay read the SNI, signed a 24-hour leaf for that one name with the CA profile of S09-policy-credentials-auditS09-policy-credentials-audit: Policy, Credentials, Certificates and AuditWhere policy comes from, how secrets are held, how TLS inspection is trusted, and what is recorded. (P-256, pathLen:0, keyCertSign only, no name constraints; the leaf one dNSName, serverAuth, no common name, no key usage), passed the client’s ALPN list upstream, and logged each client’s alert. Session tickets were off, so each connection was a full handshake. Its log has 448 connections.
  • Control. With no trust anywhere, every one of the 27 client runs failed its request, and the relay logged each client’s refusal (“unknown certificate authority”, “bad certificate”, or a closed connection). The verdict comes from the relay’s log and the client’s output, not from exit codes. Four runs in matrix-none.jsonl exit 0 (go-mod-download, swiftpm-cli and both xcodebuild-spm runs), though the relay logged the refusal and the output shows the failed fetch. Their commands end in a pipe. In the later runs the same commands exit non-zero when they fail, for example swiftpm-cli with 1 and both xcodebuild-spm runs with 74 in matrix-only-SSL_CERT_FILE.jsonl.
  • Variables. With all eight variables set, every client but the URLSession ones passed. Then one variable at a time, for the table above.
  • Reread. Six long-running clients from a file with one CA, the file replaced by one with two at 25 s, a second group started then, and the relay switched to the second CA at 45 s.
  • Install time. Writing the variable files, with the Java trust store, took under 1 s. The system store refused in 0.3 s.
  • The relay’s own upstream checks. 6 of the 448 upstream handshakes failed the relay’s own check (“certificate is not trusted”), all on connections that sent no ALPN, to api.anthropic.com, registry.npmjs.org and example.com. Each is followed 6 to 25 ms later by a client’s “bad certificate” alert for the same name (lines 45 and 46, 100 and 101, 194 and 195, 263 and 264, 352 and 353, 417 and 418 of proxy.jsonl). The last pair is the error of group B’s Node client at 01:37:21 in the reread test. The likely cause is trustd’s own fetches being redirected by pf into the relay, which runs as nobody. It is unexplained, it is a property of the stand-in and not of wb-proxyd on the host, and no conclusion rests on it.

Branch spike/x04-tls-inspection, at 7e10eab: the wb-vmd stand-in with a read-only share, the relay, the clients, the guest scripts, and the raw results in results/. The spike’s bundle g1 is a spike artifact, and no product image may descend from it.

Status: Answered 2026-10-08: no