C02 - Streams, TLS, and the Inspection CA
Purpose: The test cases for the streams wb-proxyd takes over:
the hand-off from wb-netd, the first-byte and TLS checks, upstream
addresses, the HTTP request form, and the inspection CA’s leaves,
rotation, and keys.
Verifies: S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach., S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes. (“Upstream address”), S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP., S07-08-requests-and-credentialsS07-08-requests-and-credentials: Requests and CredentialsThe form of each request wb-proxyd sends upstream, and how it removes the guest's credentials and injects bound ones. (“Request form”), S07-16-tls-and-tunnelsS07-16-tls-and-tunnels: TLS and TunnelsWhat wb-proxyd does with client certificates, encrypted ClientHello and tunnels, and which refusals no mode or approval relaxes. (“Method overrides”), S09-06-ca-keysS09-06-ca-keys: CA KeysHow the key of each TLS inspection certificate authority is made, stored and restored, and when a CA is valid. (“Valid CA”), 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”), S09-08-guest-trustS09-08-guest-trust: Guest TrustHow wb-guestd makes the guest's clients trust the VM's CAs.
Unit tests
Section titled “Unit tests”Stream hand-off
Section titled “Stream hand-off”Two VMs at different generations. On VM A’s hand-off socket the test sends these streams:
- one whose generation field is VM B’s;
- one to an address only VM B’s copy holds, and one to an address with no entry;
- one on a port the name’s policy doesn’t allow;
- one to a name that a policy change removed after its report;
- one with no descriptor, one with two, and one with three, which the
channel refuses with
fdchan-fd-count; - one with a datagram socket, and one with a socket that isn’t a Unix domain socket, as the stream;
- one sent right behind a report that waits on
wb-hostdfor the wildcard budget, which passes once the report is accepted; - one in a message over 4 KiB;
- streams past the per-socket cap, while VM B’s streams still pass.
On the same socket it sends name reports with:
- a name only VM B’s policy allows;
- a name that fails the name form rule;
- a name with a capital letter or a trailing dot;
- an address outside the synthetic range;
- new names under a wildcard past the wildcard budget.
Each is refused and logged with its rule and check, a refused stream
gets a StreamReset, and the stream handler sees none of them, so
wb-proxyd doesn’t resolve a name upstream, open an upstream
connection or fetch a binding. The malformed ones also close VM A’s
hand-off socket and its streams, and wb-proxyd sends
HandoffSocketClosed: a name not in canonical form, an address outside
the range, a stream of the wrong form (no descriptor, two, three or
over 4 KiB), and a record that doesn’t decode. wb-hostd ends VM A’s
wb-netd and counts the exit.
- Report an address held for another name twice, once with no stream open and once with a stream to it open, and see the old entry removed and the open stream closed.
- Replay the live entries, and see the copy and the wildcard count unchanged.
- Block the accounting record of a wildcard name for more than 100 ms, and see the name refused.
- Release an address the copy doesn’t hold, and see it logged with
release-unheldand ignored. Release one with a stream open, and see the open stream left as it was and a new one refused. - Narrow the effective policy with streams open, and see each stream it
no longer allows reset with
policy-recomputedbefore thePolicyAck. - From
wb-hostd, send hand-off messages with an older generation, a VM that isn’t a VM slot, the build VM of a running image build, and aSOCK_STREAMsocket, and see each refused withhandoff-socket-refused. Send a datagram with two descriptors, and see it refused withcontrol-message-refused. Each refusal ends the control channel. A socket number that isn’t above the held one is refused the same way. An equal generation with a higher number replaces the old socket and closes its streams (S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log.). - Change the effective policy, and see it reach
wb-netdonly afterwb-proxydhas acknowledged it. - Fill VM A’s hand-off socket so a
StreamResetcan’t be sent, closewb-netd’s end, and send control data that is cut. See each close A’s socket withHandoffSocketClosedand its rule and check (S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log., “Closing a socket”), and B’s streams pass. - Stop reading a stream’s socket as
wb-netd, and see the write reset withstream-write-timeoutand the upstream connection closed (S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log., “Stream bounds”). Close the hand-off socket meanwhile, and see the close not wait for the write (S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log., “wb-proxyd’s end”). - Send a stop end with streams open on two of A’s sockets, and see both
closed, the counts queued, and
HandoffSocketEndedname the last record’s sequence, also for a socket already closed and withwb-proxyd’s event channel held (S07-21-vm-endS07-21-vm-end: A VM's End in wb-proxydHow wb-hostd ends a VM's hand-off sockets in the one wb-proxyd, and how the VM's last event records reach its stop record without one VM's stop or backlog taking the other VM's network down.). - Send a stop end with
wb-proxyd’s event queue at its cap, and see the end’s records queued past it and the answer in time. Send a socket end, and see only the sockets closed and no sequence named. - Hold a stream’s handler in an upstream dial, a name lookup and a
secret fetch, then send a stop end. See each cancelled, a handler past
the bound counted in
stream-end-unrecorded, and no record of the VM after the answer. - Start
wb-proxydwith a descriptor limit it can’t raise, and see it exit withproxyd-descriptor-limit(S07-20-handoff-socketsS07-20-handoff-sockets: Hand-off SocketsThe life of one VM's hand-off socket: its identity, the acknowledgments of both ends, how it closes, who a failure is charged to, what each restart does to it, and which of its decisions reach the audit log., “Who a failure is charged to”).
On macOS, internal/proxyd/handoff runs the wb-proxyd cases over
socketpairs (receiver_darwin_test.go), and the reset that can’t be
sent with a fake channel (TestResetSendFails).
TestMalformedReportEndsOneNetd in internal/hostd/egress
(crossvm_darwin_test.go) runs wb-hostd’s side with a real
wb-proxyd receiver over socketpairs. VM A’s wb-netd sends a name
with a capital letter. wb-proxyd closes A’s hand-off socket, and
wb-hostd ends A’s wb-netd with name-report-malformed. VM B’s
streams still pass, wb-hostd keeps B’s wildcard name, and
wb-proxyd isn’t ended (SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another.).
Upstream addresses
Section titled “Upstream addresses”Spec: S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes., “Upstream address”. The tests are in
internal/proxyd/upstream.
- One address inside and one just outside each range, with
169.254.169.254,192.0.0.8,::ffff:127.0.0.1,::127.0.0.1,64:ff9b::a00:1, 6to4 and Teredo addresses that embed a public IPv4 address, and public addresses that pass (TestRefused). - With a fake reader of the host’s networks, an address assigned to an
interface, an address in an on-link IPv4 prefix, a global IPv6
address in an on-link prefix and the IPv4-mapped form of an
interface address are refused, and nothing is dialed
(
TestDialHostNetworks). The networks are read at each connect (TestDialReadsNetworksEachTime). - With a fake resolver, a name with one bad address among good ones is
refused, nothing is dialed, and the refusal is logged with the host,
the address and
upstream-address-refused(TestDialRefusesOneBadAddress). A good name is dialed at the checked address after one lookup (TestDialGoodName), and its addresses are tried in order (TestDialInOrder). A failed lookup and one with no address giveupstream-resolve-failed(TestDialResolveFailed). - A name that resolves to
127.0.0.1reaches no listener there (TestDialLoopback).
Stream checks
Section titled “Stream checks”Spec: S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP., S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes. (“Name
binding”), S07-16-tls-and-tunnelsS07-16-tls-and-tunnels: TLS and TunnelsWhat wb-proxyd does with client certificates, encrypted ClientHello and tunnels, and which refusals no mode or approval relaxes. (“Pass”). The tests are in
internal/proxyd/stream, with a fake hand-off side for each stream
and loopback upstream servers, and in internal/proxyd/tlsparse. Each
reset is logged with its rule, its check and what the first bytes
looked like, and reaches the audit hook.
- Send a ClientHello whose SNI differs from the stream’s name, one
without an SNI, one with an IP address and one with a trailing dot,
and see each reset with
tls-sni-mismatchand nothing dialed. An SNI in upper case goes to the Inspector, with its bytes to read again (TestC02SNIBinding). - Send SSH, a PostgreSQL startup message, an
SSLRequest, a cleartext HTTP/2 preface and an HTTP request line to a TLS port, and an HTTP/2 preface, a ClientHello, SSH and an HTTP/0.9 request line to port 80. See each reset withstream-protocol-mismatchand the protocol it looked like, and nothing dialed (TestC02FirstBytesMismatch). HTTP/1.1 and HTTP/1.0 request lines sent a byte at a time go to the Inspector (TestC02PlainHTTP). A port with no protocol is reset (TestC02NoProtocol). - Open a stream and don’t send, and send a ClientHello a byte at a
time, and see each reset with
stream-first-bytes-timeout(TestC02FirstBytesTimeout). - Send a ClientHello split over three records, and a flight of exactly
the byte cap, and see each taken. A flight one byte past the cap is
reset (
TestC02ClientHelloRecords). - Send an ALPN list of only
ftp, and one of onlyh2, and see each reset. A list that nameshttp/1.1, alone or with others, and no list go to the Inspector (TestC02ALPN). A host in audit goes to the Inspector in audit mode, after the same checks (TestC02AuditMode). - To a pass host, send ClientHellos that hold an
encrypted_client_helloor encrypted SNI extension (tls-ech-pass),early_data, an unknown extension (tls-extension-unknown), or another SNI. See each reset before any dial (TestC02PassHello). - To a pass host, before the ServerHello, send application data, a
handshake record that isn’t a ClientHello, a second ClientHello
without a HelloRetryRequest, a second change cipher spec, one that
isn’t the byte
0x01, and after a HelloRetryRequest a second ClientHello with another SNI or with ECH. See each reset with its rule, and the server get only the records that passed (TestC02PassRecords). A ServerHello after a HelloRetryRequest and before the second ClientHello (TestC02PassServerHelloEarly), and a server’s application data, second HelloRetryRequest or bytes that aren’t TLS (TestC02PassServerRecords), are reset too. - See one change cipher spec relayed, and the bytes after the
ServerHello relayed unchanged both ways (
TestC02PassOneCCS). See an alert close both ways withtls-client-alert, its level and description logged, and the alert not relayed (TestC02PassAlert). - Run a full TLS 1.3 handshake of
crypto/tls, with a HelloRetryRequest, through a pass relay (TestC02PassHandshake). - Relay a server-first protocol through a raw TCP entry
(
TestC02RawRelay). A pass and a raw TCP stream to a name that resolves to127.0.0.1are reset withupstream-address-refused(TestC02UpstreamRefused). - Remove the raw TCP entry of an open relay, and take an open pass
relay’s host out of the pass list, and see each relay end both ways
with
policy-recomputed(TestC02PolicyRecomputed). Each logs its one allowed record and no refusal of its own. - Reset a stream from the hand-off’s side while its first bytes are
read, during its dial, and as its dial opens. See no refusal and no
allowed record logged by the handler, and nothing reach the
upstream server (
TestC02EndedByHandoff). Reset a pass stream after its dial opened and passed its end check, before its ClientHello is sent, and see the same (TestC02ResetBeforeHelloSend). - Stall a pass relay’s ClientHello write upstream. See the write end
at its deadline, the relay end with
first-send-timeout, and a hand-off reset during the write wait no longer than that (TestC02FirstSendTimeout). - Close
wb-netd’s end of a raw and a pass relay’s socket while upstream sends nothing. See the stream and the upstream connection close, withstream-peer-closedin the relay’s end record (TestC02NetdClosedRaw,TestC02NetdClosedPass). Half-close it instead, and see upstream half-closed and the server’s later answer reach the guest (TestC02NetdHalfClosedRaw). On the receiver’s sockets, a read sees a half-close as an end of file and a later close asErrPeerClosed. The stream keeps its place under the stream cap until it’s closed (TestStreamPeerClosed). A relay reads only to the first end of file, so it waits for the later close instead.wb-netdcloses its end after its half-close while upstream is silent (TestC02NetdClosedAfterHalfCloseRaw), or once the relay blocks toward an upstream that doesn’t read (TestC02NetdClosedUpstreamNotReading). The stream and upstream close withstream-peer-closed. On the receiver’s sockets the wait sees the close with no read, and the closed stream frees its place under the cap (TestStreamWaitPeerClosed). The wait ends with the stream and oncewb-proxyd’s own end shut down its writes (TestStreamWaitEnds), and doesn’t leave a descriptor or goroutine behind (TestWaitLeavesNothing). The stream’s end frees its place only once the wait returned (TestStreamEndWaitsForWait), and a raw relay holdsDescriptorsPerStreamdescriptors (TestDescriptorsPerStream). A failed wait resets the stream withstream-hangup-wait-failed(TestC02HangUpWaitFailedRaw), and on Windows the wait refuses (TestWaitUnsupported). A reset on the socket reads asErrPeerClosedtoo (TestHangUpReset), and the hang-up check answers under a deny-all Seatbelt profile (TestHungUpConfined). tlsparserefuses each malformed record and ClientHello with its check (TestReadClientHelloRefuses), and reads a server’s records only to its ServerHello (TestServerFlight).
TLS termination
Section titled “TLS termination”Spec: S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP. (“Inside TLS on an inspected host”),
S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes. (“inspect”), S07-16-tls-and-tunnelsS07-16-tls-and-tunnels: TLS and TunnelsWhat wb-proxyd does with client certificates, encrypted ClientHello and tunnels, and which refusals no mode or approval relaxes.. The tests
are in internal/proxyd/inspect, with Go test clients and servers on
loopback, a CA made in the test, and fakes for the leaves, the
stream’s control and the HTTP handler. Each refusal is checked in
inspect and in audit mode, and is the same in both.
- A client that trusts the CA completes the handshake with TLS 1.2 and
1.3, offering
http/1.1,h2andhttp/1.1, or no ALPN. It gets HTTP/1.1, its first request reaches the HTTP handler, the leaf is asked for the stream’s VM, generation, name, port and policy, and nothing is dialed (TestC02InspectHandshake). A plain HTTP stream goes to the HTTP handler with no leaf (TestC02InspectPlainHTTP). - See that the client doesn’t hold a session ticket after the handshake, with TLS
1.2 and 1.3 (
TestC02InspectNoSessionTickets). - A refusal from the leaf interface resets the stream with its rule
(
TestC02InspectLeafRefused). Anh2-only client’s handshake fails (TestC02InspectALPN). - A Go client with an ECH configuration aborts with
ech_required, and the stream is reset withtls-ech-refused(TestC02InspectECH). - A Go client that distrusts the CA, with TLS 1.2 and 1.3, or that
expects another name, aborts. The stream is reset with
tls-client-rejected-leaf, the alert’s description and the known gap of FR08-no-proxy-configFR08-no-proxy-config: No per-tool proxy settingsAllowlisted network destinations work for every tool without per-tool proxy configuration. (TestC02InspectRejectedLeaf). A client that closes after the server’s flight, during the handshake or after it with no request byte, is logged the same way withclosed(TestC02InspectClientClosed). Every alert code classifies by its structure, never by its text alone, and a reset after the server’s flight isclosedas a close is (TestHandshakeErrorRule). - After the handshake, send SSH, the HTTP/2 preface, a line past the
cap, a partial line and then the end, nothing, and a partial line.
See each reset with
stream-protocol-mismatchorstream-first-bytes-timeoutand its check, and nothing dialed (TestC02InspectAfterHandshake). A client that stalls in the handshake meets the same deadline (TestC02InspectDeadlineCoversHandshake). - Upstream, see the server verified for the stream’s name, offered
http/1.1only, and that it doesn’t get a client certificate when it asks for one (TestC02UpstreamTLS). A plain HTTP stream gets the dialed connection (TestC02UpstreamPlain), and a dialer’s refusal comes back with its rule (TestC02UpstreamDialRefused). Both connections count the bytes unread in the dialed socket (TestC02UpstreamUnread). - An upstream that requires a client certificate gives
tls-client-cert-unsupported, with TLS 1.2 in the handshake and with TLS 1.3 on the first read (TestC02UpstreamClientCert). One whose CA the roots don’t trust, or whose certificate names another host, givesupstream-tls-verify(TestC02UpstreamVerify). One that isn’t TLS givesupstream-tls-failed(TestC02UpstreamFailed). - An upstream that asks for a client certificate with TLS 1.3 and
then closes with no alert gives
upstream-tls-failed, and a first read past its deadline returns the timeout with no refusal (TestC02UpstreamCertAskedThenFailed). A timeout or a canceled stream isupstream-tls-failedafter a request, and onlyhandshake_failure,bad_certificateandcertificate_requiredcount as a refused certificate on the first read (TestUpstreamRule). - A stream that ends while the upstream handshake waits on the server
gives
handoff.ErrEnded, and noupstream-tls-failedis logged, though the end closed the connection beforeDoneclosed (TestC02UpstreamEndDuringHandshake). Newrefuses a configuration without leaves, a dialer or an HTTP handler (TestNew), and a leaf interface that returns neither a leaf nor a refusal resets the stream withca-leaf-refused(TestC02InspectLeafRefused).
Leaf issuance
Section titled “Leaf issuance”- Ask
wb-proxydfor a leaf for a host the policy doesn’t inspect, a host in pass mode, a stream whose SNI differs from its hostname, a hostname on another VM’s stream, and a VM whose only CA has expired. In every casewb-proxyddoesn’t sign a leaf. The pass-mode stream is relayed unchanged, and each other stream is reset and logged with its rule. - In
internal/proxyd/ca, over the fake key store and the fake secret store (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., “Leaf issuance”):- Ask for a leaf for a wildcard, an IP address, a name not in
canonical form, a VM with no CA set, an older generation, a VM
with no signing CA, and an expired CA with a leaf cached. See each
refused with
ca-leaf-refusedand its reason, orca-not-installed, and logged (TestC02LeafRefusals). - Ask for a leaf for a pass host, plain HTTP, a raw TCP entry, a port
outside every endpoint and a stream with no policy. See each refused
with
ca-leaf-refused, logged, and nothing signed (TestC02LeafNotInspected). - Ask for one new hostname’s leaf from 8 calls at once, and see it
signed once and each call get it (
TestLeafSingleflight). - Make the first signature of a new hostname’s leaf fail, then
panic. See the flight end each time, with
ca-leaf-refusedwhen it fails, and the next call sign the leaf (TestLeafFlightFails). - See a leaf with exactly the leaf profile, a chain of the leaf only,
and a validity cut to the CA’s end, that verifies against its CA
(
TestC02LeafProfile). - See the cache return the same leaf for the same VM, CA and
hostname, a new one an hour before its end and after a signing CA
change, and drop the least recently used leaf at its cap
(
TestC02LeafCache). - See a leaf signed for one VM fail to verify against another VM’s CA
(
TestC02VMScope), and the package’s API give or take nox509.CertPool(TestNoCertPool). - See a VM’s streams refused until
wb-hostdaccepts the CA set’s generation, and a CA set of an older generation end the control channel (TestC02AcceptGating). - See
wb-proxyd’s hand-off receiver, which has no CA handler yet, refuse a CA message and end the control channel (TestCAMessageRefused).
- Ask for a leaf for a wildcard, an IP address, a name not in
canonical form, a VM with no CA set, an older generation, a VM
with no signing CA, and an expired CA with a leaf cached. See each
refused with
CA rotation
Section titled “CA rotation”On a fake clock, with each step checking its 5019 event:
- Day 30 issues and installs the successor.
- Day 58 switches only after the install is recorded, and otherwise
refuses the VM’s streams with
ca-not-installed. - Day 60 removes the old CA and destroys its key.
- A restore and a host wake each follow this order: clock set, expired
CAs removed, the current CAs installed from the host’s record, and
only then streams accepted, signed with the CA
wb-proxydsigned with before the save or the sleep. - A save on day 40 and a restore on day 45 keep signing with the old CA.
- A host that sleeps from day 50 to day 61 removes the old CA before it accepts a stream.
- In
internal/hostd/carecord, over a fakewb-proxyd, a fake guest and a fake clock, each with its 5019 events:- Day 30 issues the successor, sends both in the CA set and records
the install (
TestC02RotationDay30). - Day 58 switches once the install is recorded
(
TestC02RotationDay58), and otherwise leaves the VM without a signer and logsca-not-installed(TestC02RotationDay58NotInstalled). - Day 60 drops the old CA and puts its item on the removal list
(
TestC02RotationDay60). - A boot runs the seven steps in order (
TestC02RotationBootOrder). A restore and a wake keep the old signer (TestC02RotationRestoreAndWakeKeepSigner), also from a save on day 40 to a restore on day 45 (TestC02RotationSaveDay40RestoreDay45). - A sleep from day 50 to day 61 drops the old CA before the accept
(
TestC02RotationSleepDay50To61). - An install the guest doesn’t report in time refuses the VM’s
streams with
ca-install-unreported(TestC02RotationInstallUnreported).
- Day 30 issues the successor, sends both in the CA set and records
the install (
CA key
Section titled “CA key”Spec: S09-06-ca-keysS09-06-ca-keys: CA KeysHow the key of each TLS inspection certificate authority is made, stored and restored, and when a CA is valid., “Valid CA”.
- Hand
wb-proxyda token object ID of another key, random bytes, a missing item, and a restore that returns an error. See each VM start refused withca-key-restore, and no new CA issued untilwb vm reset-ca. - Fail an issue’s read-back or restore, and see the record unchanged and its item deleted.
- Through the cgo shim, read back a new CA key and its item, and check
that a keychain search for the key finds nothing,
kSecAccessControlPrivateKeyUsageas the only access control flag,kSecAttrAccessibleWhenUnlockedThisDeviceOnly, andkSecAttrSynchronizablefalse. - On Linux, record “software” on a host with a TPM, and “TPM” on one
without, and see each CA issue and restore refused with
ca-key-store-mismatch. - Run
wb vm reset-caandwb setup --ca-key-store, and see each write a 5019 event with the command and each dropped CA’s fingerprint. - In
internal/proxyd/ca, over the fakes:- Restore from the wrapped form of another key, a token of another
key, random bytes, a missing item, and a restore error. See each
CA set fail with
ca-key-restore, the VM get no leaf, and no key made or left open (TestC02RestoreFails). A CA set whose certificate isn’t the item’s fails the same way (TestC02RestoreBadCertificate). - Fail an issue’s read-back and restore, and see its item deleted
(
TestC02IssueRoundTripFails). An issue for a CA id in use, for either VM and also after a CA set that failed to restore, fails withca-issue-refusedand no store call (TestC02IssueRefused). After a restart, an issue for an id whose item the store holds fails withca-issue-refusedand leaves the item, and a failed write deletes nothing (TestC02IssueStored). - See a locked store wait, log the wait once and continue at the
unlock (
TestC02StoreLockedWaits), and fail closed when the wait ends (TestC02StoreLockedCancel). See an ad-hoc signed build fail withkeychain-needs-team(TestC02AdHocStore). - See a new CA with exactly the CA profile (
TestC02IssueProfile).
- Restore from the wrapped form of another key, a token of another
key, random bytes, a missing item, and a restore error. See each
CA set fail with
- In
internal/platform/hwkey, on a Mac VM such as CI’s macOS runners, run the real shim unsigned against the VM’s virtual Secure Enclave (S09-06-ca-keysS09-06-ca-keys: CA KeysHow the key of each TLS inspection certificate authority is made, stored and restored, and when a CA is valid., “macOS, every build”). Generate a key, and sign a SHA-256 digest that Go verifies. Restore the key from its wrapped form, and see the same public key and a signature that verifies, and a closed key refuses to sign (TestC02VMRoundTrip). It makes no Keychain call and stores nothing, and it skips on a Mac that isn’t a VM. A Mac without a Secure Enclave, whose generate and restore give the framework’s error, has no test: CI has no such Mac. - In
internal/platform/hwkey, in pure Go on every OS, feed the reader of the wrapped form a form generate gave, and see it pass. See the reader refuse each form whose structure or encoding differs: a length one short or long at each level, a long-form or indefinite length, a wrong tag or name, fields out of order, a field more or less, a size or fixed value changed, a changeded, bytes after an element, and the form cut short (TestWrappedGenerated,TestWrappedRefused). Any bytes in the key fields are taken (TestWrappedKeyBytes). These tests pass their changed forms to the reader only, never to the Secure Enclave or the Keychain. So a form with changed key-field bytes is deliberately not tested on hardware. - In
internal/platform/hwkeyon darwin, see Restore refuse a form with one changededbyte and a live context, with the shim’s call replaced by a stub that fails the test when called (TestRestoreRefusesForm). - In
internal/platform/hwkey, see the check that each restore runs refuse a key whose signature doesn’t verify with its public key, and one that fails to sign (TestCheckPossession, S09-06-ca-keysS09-06-ca-keys: CA KeysHow the key of each TLS inspection certificate authority is made, stored and restored, and when a CA is valid., “kSecAttrTokenOIDis undocumented”). - On the maintainer’s Mac, with the real store and Secure Enclave, in
the bundles of
mise run store:host-test(C05-credentials-and-storeC05-credentials-and-store: Credentials and the Secret StoreThe test cases for the secret store and its callers, the signing setup that gives development builds their Keychain groups, and the credential checks wb-proxyd makes on guest requests and server responses., “Host tests”). The run skips them on a Mac VM, and the maintainer watches for a dialog or a Touch ID prompt, which fails them.- In
internal/platform/hwkey, generate a key, sign and verify with Go, and restore it from its wrapped form in the same process and in a second one, whose signature verifies with the first public key (TestC02HostKeyRoundTrip). The same test restores a second key’s wrapped form and sees the second key, not the first. Read back a new and a restored key and see each in the Secure Enclave, in no keychain, and withkSecAttrAccessibleWhenUnlockedThisDeviceOnlyand nothing required for any operation (TestC02HostKeyAttributes). The same search finds a permanent key that the test makes and deletes again, and the test fails when an earlier run left one with its label (TestC02HostKeyPermanentProbe). - In
internal/proxyd/ca, in a bundle namedwb-proxyd, issue a CA, read back its item’s attributes, and restore it in a second process that signs a leaf the CA verifies (TestC02HostIssueRoundTrip). Overwrite the item with another CA’s wrapped form, and see the CA set fail withca-key-restore(TestC02HostRestoreWrong). Issue, restore and sign underwb-proxyd’s profile as X23-sandboxed-daemonsX23-sandboxed-daemons: Self-sandboxed Go daemons on macOSCan wb-netd, wb-proxyd and wb-hostd confine themselves at start with a sandbox profile, as S04-architecture says, while the Go runtime, inherited descriptors, and Keychain and Secure Enclave access in wb-proxyd keep w… ran it (TestC02HostConfined). The bench step prints the leaf’s signature with the Secure Enclave key beside the fake key’s (BenchmarkC02HostLeaf,BenchmarkLeaf). - The run of 2026-11-10 passed every step with no dialog. A wrapped form was 324 bytes, and a leaf took about 4.7 ms with the Secure Enclave key and 0.10 ms with the fake (I509I509 (closed): platform: Secure Enclave CA key kept as its wrapped form, with the CA item round trip on the maintainer's MacPackage M3.9 of docs/implementation-plan.md, part 4 of 5 (M3.9d).).
- The run of 2026-11-28 on a Mac mini (M6, macOS 27.2.1) at
9dc62512passed every step with no dialog. A wrapped form was 324 bytes, and a leaf took about 4.5 ms with the Secure Enclave key and 0.06 ms with the fake (I509I509 (closed): platform: Secure Enclave CA key kept as its wrapped form, with the CA item round trip on the maintainer's MacPackage M3.9 of docs/implementation-plan.md, part 4 of 5 (M3.9d).).
- In
- In
internal/hostd/carecord, see a restore failure refuse the start withca-key-restoreand issue nothing, and afterwb vm reset-cathe next boot issue a new CA and remove the old one’s item (TestC02CAKeyRestoreFailed). - In
internal/vmcmd, against the real service and CA record, seewb vm reset-carefused without a terminal, on a wrong answer and while the VM runs, each leaving the record as it was (TestResetCARefusals). On success see the record empty, both items on the removal list and one 5019 event with the command (TestResetCAAccepted).
CA removal list
Section titled “CA removal list”Spec: 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”.
- Hand
wb-proxydbatches withbinding/x,wbadmin/build/x, a name with a part outside the fixed form, and an entry whose CA is still in the record, each next to a valid entry. See each batch refused withca-removal-refusedand nothing deleted. Then seewb-hostddrop an entry refused for its form and log it, keep one refused because its CA is in the record until the VM’s next CA set, and the next batch delete the valid one. - Report an entry whose item is gone, and see it counted as deleted.
internal/proxyd/cacovers thewb-proxydside: the refused batches, each entry before and after the valid one, an entry of another VM’s CA set and one of a CA set that failed to restore among them (TestC02RemovalRefused), and the deletes, an item already gone and a failed delete (TestC02RemovalDeletes).internal/hostd/carecordcovers thewb-hostdside: a list of 3 entries, and one of 70 sent as batches of 64 and 6, with deleted entries dropped, entries refused for their form dropped and logged, and the rest sent next (TestC02CARemovalList). An entry refused because its CA is in the record stays, logged, and goes out after the VM’s next CA set (TestC02CARemovalHeldBack).
Guest trust
Section titled “Guest trust”Spec: S09-08-guest-trustS09-08-guest-trust: Guest TrustHow wb-guestd makes the guest's clients trust the VM's CAs.. The tests are in internal/guestd/trust, in
a temporary directory, unless named otherwise.
- Install one CA, then two, then one of the two. See
ca.pemhold the CAs in order,bundle.pemthe public roots then the CAs, andjava-truststore.p12parse back without a password to the bundle’s certificates, each file mode 0644 and the directory and its parent 0755 under a umask of 077 (TestC02TrustFiles). - Send an empty list, four certificates, a leaf, an RSA CA, a P-384
CA, garbage and the same CA twice. See each refused with
trust-install-refused, logged with the rule, and the directory unchanged (TestC02TrustRefused). - Make the directory a symlink, a file, mode 0777, 0700 or setgid,
or owned by another user (as root only). Make its parent a symlink,
writable by its group or by others, or owned by another user (as
root only). See each refused with
trust-dir-unsafeand nothing written (TestC02TrustDirUnsafe). - Make the public roots missing, a directory, a FIFO, empty of
certificates or over 4 MiB, and see each fail with
trust-install-failedand nothing written (TestInstallRootsFailed). Cancel the call’s context, and see the same (TestInstallCanceled). - Install a CA that wb-proxyd’s CA authority issued with the fake key,
then a new one. A Go
tls.Clientin a child process withSSL_CERT_FILEset to the bundle accepts the new CA’s leaf, and one with the first install’s bundle refuses it (TestC02TrustTLSClient). - When a JDK’s
keytoolis onPATH, it lists the Java trust store without a password, every entry trusted (TestC02TrustKeytool). - The trust variables have their exact values (
TestC02TrustEnv), andinternal/guestd/shellputs them after the account’s variables (TestEnvironment) and refuses a host value of any of their names (TestRefusals). - No Go file of wb-guestd names a call that adds a CA to the system
trust store (
TestC02NoSystemTrustStore). - In
internal/guestd, InstallTrust hands the certificates on in order and answers each rule with its code and ErrorInfo (TestC02InstallTrustRPC).
Guest trust on a VM (needs-vm)
Section titled “Guest trust on a VM (needs-vm)”TestC02GuestTrustVM in cmd/wb-hostd, needs-vm, as
TestC11HostdVM in C11-host-daemonsC11-host-daemons: Host Daemons, Audit, and DisksThe test cases for the host daemons' own checks: wb-vmd's device set and slots, the image build bundle, supervision, the accounting and event channels, the daemon log pipes, the audit writer, free space, and the data…: it runs under a test data root
the same way. It runs with the variables and the go test
command of mise run go:test-vm, with -run '^TestC02GuestTrustVM$'.
wb-proxyd doesn’t run. The child wb-hostd gets a fake wb-proxyd end
of the control channel, wb-proxyd’s CA authority over the fake secret
store and the software fake key, so no Keychain item is made. The boot
time call runs the CA record’s boot order (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.,
“Boot, restore and host wake”), until I583I583 (closed): wb-hostd: run the CA keeper: boot order at VM start, ProxydStarted, the rotation tick and host wakeNamed by the code review of #581 (finding 1), which builds #507. wires it in wb-hostd. The
fake writes a leaf for wbtest.invalid to .scratch/go-test-vm/trust
for each accepted CA set. In wb shells of a project it adds, the test
checks:
- the project user’s environment holds the six trust variables with their values;
/etc/wraithbox/trustis mode 0755 and holds exactly the three files, each owned by root with mode 0644, and its parent is owned by root and not writable by its group or others;ca.pemis the record’s CAs in order,bundle.pemends with them after the public roots, andjava-truststore.p12holds the bundle’s certificates;security find-certificate -a -Zover the system keychains lists certificates, and none is a CA of the record or names Wraith Box;- a TLS server (
testdata/tlsserver, built for darwin/arm64) on the guest’s loopback, with the leaf, is accepted by curl,git ls-remote(dumb HTTP),python3with urllib,nodewithhttps.get, and, when the image has a JDK, Java with onlyJAVA_TOOL_OPTIONS. Each client runs with the shell’s environment and nothing the test adds, and is told the server’s address. curl is in the base system and must run. Any other client the script marks missing is logged as not run, and a client with no whole block in the output fails the test; - URLSession, from
osascript -l JavaScriptthrough the server’s CONNECT proxy, refuses the leaf with NSURLError -1202 or -1203, and the server logs a failed handshake after that tunnel; - after
wb vm stop,wb vm reset-ca workand a new start, the record holds one new CA, no trust file holds the old one, every client refuses the old leaf with its certificate error and accepts the new one.
The test sends the server, the leaf and its key to the guest only on
the shell’s standard input (SEC02-no-host-fs-shareSEC02-no-host-fs-share: No host filesystem sharingNo host directory is mounted into the guest, read-only or otherwise.), and logs each
client’s outcome with result:. Unit tests of the same package check
the fake against the CA record, a reset included
(TestFakeCABootWritesLeaf, TestFakeCAResetWritesNewLeaf,
TestFakeCABootHook), the server (TestTLSServer), the script and
its output (TestParseClients,
TestClientsScriptCarriesServerAndLeaf), and the judgment of each
client’s outcome (TestJudgeProbeFailsClosed).
Runs: none yet.
Fuzzing
Section titled “Fuzzing”- Upstream addresses: arbitrary 16-byte addresses, checked against a
second reading of the ranges (
FuzzUpstreamAddress). - TLS ClientHello parsing, a ClientHello split across TLS records
included:
FuzzClientHellofeeds any bytes, whole and split into records at any points. The parser doesn’t panic, decides the same on the bytes cut at the cap, so it doesn’t read past it, and a server name it accepts is in the name form.FuzzServerFlightchecks that the server’s records are read within the cap with at most one HelloRetryRequest. - The first-byte protocol check of S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP.:
FuzzFirstByteschecks that a TLS port takes nothing the ClientHello parser refuses, that port 80 never takes the HTTP/2 preface, and that a decision on a prefix holds for the whole.FuzzPassClientRecordschecks that before the ServerHello a pass relay sends upstream at most one change cipher spec and, after a HelloRetryRequest, one ClientHello that passes the pass checks.FuzzPassInterleavedsteps the relay’s client and server directions in any order, and checks that the checks end only when no second ClientHello is owed. - The guest handshake’s errors:
FuzzHandshakeErrorRulefeeds any error text, plain, wrapped or in a*net.OpErrorwith anyOp. It never classifies astls-ech-refusedortls-client-rejected-leaffor anything but a received alert, and gives one of them for every received alert. - HTTP/1.1 and HTTP/2 request handling, and request path
canonicalization.
FuzzHTTP1RequestHead,FuzzCanonicalPathandFuzzHTTP1Conncover HTTP/1.1. - The name reports, releases and stream messages
wb-proxydreads fromwb-netd, and the hand-off messages it reads fromwb-hostd(S07-05-stream-hand-offS07-05-stream-hand-off: Stream Hand-offHow wb-netd hands each stream to wb-proxyd, and the checks that keep a compromised wb-netd from widening what a stream may reach.).FuzzNetdMessagechecks that an accepted message has a canonical name, an address inside 198.18.0.0/15, a stream’s generation, id and port of at least 1, and a descriptor on a stream and no other message. The message encodes again within 4 KiB.FuzzProxydMessagedoes the same for theStreamResetthatwb-netdreads, andFuzzControlMessageforwb-hostd’s messages.FuzzHandoffDecisiondriveswb-proxyd’s decisions on them and checks its copy of the name mapping after each. - The CA messages of the control channel:
FuzzCAControlMessagefeeds any bytes through the decoder towb-proxyd’s CA authority over the fakes. A message that parses has a VM slot and CA ids of the fixed form, and each reply has the formcontrol.protogives it. - Leaf hostnames:
FuzzLeafNamefeeds any hostname towb-proxyd’s leaf signing over the fakes. A leaf it signs has exactly onedNSName, equal to the input and neither a wildcard nor an IP address. It isCA:FALSE, signed by the VM’s CA, and valid within the CA’s validity. wb-proxyd’s CA replies aswb-hostdreads them:FuzzProxydCAReplyfeeds any bytes to the check of a CA issued reply. It never panics, and a reply that passes has a certificate of the CA profile: a P-256 key, self-signed, and 60 days of validity.- Guest trust:
FuzzCheckCAsfeeds any certificates to the request check, and a set it accepts has 1 to 3 P-256 CAs.FuzzParseRootsfeeds any bytes as the public roots file, and sees a root or an error. - The wrapped form of the CA key:
FuzzWrappedFormfeeds any bytes to the reader the restore runs before it calls the Secure Enclave, in pure Go. It never panics or changes its input, and a form it takes has the length, theedelement, and every byte outside the key fields of a form generate gave.
Conformance
Section titled “Conformance”Stream checks
Section titled “Stream checks”- Present an SNI that differs from the resolved name.
- Send SSH, a PostgreSQL startup message and a cleartext HTTP/2 preface
to an allowed TLS port, and SSH to port 22 of a git forge. Open a
stream to an allowed port and don’t send. Send an HTTP
CONNECTand anUpgrade: h2cto an inspected host. Send a ClientHello with anencrypted_client_helloextension to a pass host. See each reset or refused with its rule from S07-15-non-http-streamsS07-15-non-http-streams: Non-HTTP StreamsHow wb-proxyd checks the protocol of each stream, and what it does with SSH, other protocols and raw TCP., and no connection opened upstream for a stream reset on its first bytes. - Send a ClientHello with a real ECH configuration to an inspected
host, and see the client abort and
tls-ech-refusedlogged. - After a HelloRetryRequest from a pass host, send a second ClientHello with another SNI, and see it reset.
- To a pass host, send client application data, or a handshake record that isn’t a ClientHello, before the server’s ServerHello, and see it reset.
- Try to add a raw TCP entry on a guarded host (
github.com,ssh.github.com, a host with a credential binding), at load and at a recompute, and see it refused with the host named.
Upstream addresses
Section titled “Upstream addresses”- With an allowed name that resolves to
127.0.0.1, an RFC 1918 address,169.254.169.254or an IPv4-mapped form of one, open an inspected, a pass and a raw TCP stream to it, and see each refused withupstream-address-refusedand no upstream connection. - Do the same for a name that resolves to an address of one of the
host’s interfaces, to an address in an on-link prefix of the host (a
global IPv6 LAN address included), to
192.0.0.8, and to IPv4-compatible, 6to4, and Teredo addresses. - Load a policy whose host is
127.0.0.1or0x7f000001, and see it refused.
Request form
Section titled “Request form”Spec: S07-08-requests-and-credentialsS07-08-requests-and-credentials: Requests and CredentialsThe form of each request wb-proxyd sends upstream, and how it removes the guest's credentials and injects bound ones., “Request form”.
- On an inspected host, send
Transfer-Encoding: gzip, chunked,chunked, chunked,identity, twoTransfer-Encodinglines,Transfer-EncodingwithContent-Length, and anyTransfer-Encodingover HTTP/2. See each get a400withhttp-transfer-codingand nothing sent upstream. - Send a chunked body with a bad chunk size, and see the request end with the same rule and the upstream request aborted.
- Send a request head over 64 KiB over HTTP/1.1, and a header list over
the announced
SETTINGS_MAX_HEADER_LIST_SIZEover HTTP/2, and see a431withhttp-header-sizeand nothing sent upstream. - To a path whose policy allows
POSTand notDELETE, send aPOSTwithX-HTTP-Method-Override: DELETE, then withX-HTTP-MethodandX-Method-Override, and see each get a403withhttp-method-overrideand nothing sent upstream (S07-16-tls-and-tunnelsS07-16-tls-and-tunnels: TLS and TunnelsWhat wb-proxyd does with client certificates, encrypted ClientHello and tunnels, and which refusals no mode or approval relaxes., “Method overrides”).
Unit tests in internal/proxyd/httpreq, below the HTTP/1.1 connection
loop:
- Each head form the parser refuses gets a
400withhttp-request-form(TestC02RequestHeadRefusals). A head over 64 KiB gets a431withhttp-header-size, and the parser takes no byte past the cap (TestC02HeadOverCap). - Origin form, absolute form with its userinfo dropped, and
Host: example.com:443on port 443 pass (TestC02RequestFormAccepted). - The canonical path:
/a/./b/../cbecomes/a/c,/@scope%2fnamestays one segment, and%2e%2eandwget%2F..%2Fcurlare refused withhttp-path-form(TestC02CanonicalPath). - The transfer codings above get a
400withhttp-transfer-codingbefore the HTTP policy step (TestC02TransferCoding). A chunked framing that fails to decode ends the body with the same rule (TestC02ChunkedFraming). CONNECTandUpgrade: h2cget a403withhttp-tunnelbefore any step (TestC02Tunnels).TRACEandTRACKget a403withhttp-trace, andtracereaches the policy step’s own check (TestC02Trace). Without the credential removal step or the HTTP policy step, a request getshttp-step-missing(TestC02StepMissing).- Each method-override field, in any case, with any other separator
such as
X.HTTP.Method.Override, empty, repeated, and named inConnection, gets a403withhttp-method-overridebefore any step, and a field whose name only resembles one passes (TestC02MethodOverride). The request steps refuse it again when the reader didn’t check it (TestC02MethodOverrideInSteps). FuzzHTTP1RequestHeadandFuzzCanonicalPathfuzz the head parser and the canonicalize step. A head the parser accepts has no method-override field that net/http reads.
Unit tests in internal/proxyd/http1, the HTTP/1.1 connection loop.
Tests check each refusal in inspect mode and in audit mode. Its
answer is text/plain with Connection: close and names the rule and
the host, and its log record names the rule:
- The transfer codings above get a
400withhttp-transfer-coding, and no upstream connection opens (TestC02HTTP1TransferCoding). A chunked body with a bad chunk size gets the same, and the upstream gets an incomplete request (TestC02HTTP1ChunkedAbort). A head over 64 KiB gets a431withhttp-header-size(TestC02HTTP1HeadOverCap). - A method that isn’t a token, a
Hostother than the stream’s name (the name its SNI gave), a field name with an_,%2e%2e,TRACE,TRACK,CONNECT,Upgrade: h2cand each method-override field, in lower and upper case, with other separators, repeated and named inConnection, are refused with their rules before the HTTP policy step. No upstream connection opens for them (TestC02HTTP1Refusals). - The request upstream is in origin form with the canonical path,
userinfo dropped and
Hostfrom the binding (TestC02HTTP1RequestForm), with no hop-by-hop field (TestC02HTTP1HopByHop). Bodies with a length and chunked go whole,Expect: 100-continueis answered bywb-proxyd, and the response step removesSet-Cookie(TestC02HTTP1Bodies). - The upstream gets the stream’s requests on one connection, which
opens once (
TestC02HTTP1KeepAlive). A refused first request opens none (TestC02HTTP1RefusedOpensNothing). A missing step, or a policy step with no recompute check, gets a500withhttp-step-missing(TestC02HTTP1StepMissing). A request after a policy change that refuses it never reaches the upstream, and its refusal is logged with the current mode (TestC02HTTP1PolicyChange). - A head past its deadline resets with
http-header-timeout, on the first request and on a later one (TestC02HTTP1HeaderTimeout). - A refused upstream connection gets a
502that names its rule, and the answer leaves out the certificate names in the error (TestC02HTTP1UpstreamRefused). A refusal on the response’s first read gets the refusal’s own rule (TestC02HTTP1UpstreamReadRefusal). When the upstream closes without a response, the guest gets a502withupstream-request-failed(TestC02HTTP1UpstreamBroken). A kept upstream connection that the server closed between requests closes the guest’s stream with no answer andupstream-idle-close, before the guest’s next request (TestC02HTTP1UpstreamIdleClose), and so does one the server closes after it read the next request (TestC02HTTP1UpstreamCloseAfterRequest). A close while the steps decide the next request leaves a refusal its answer and its record, and sends a request that passed nowhere (TestC02HTTP1StepAtIdleClose,TestC02HTTP1PipelinedRefusalAtIdleClose). Bytes the server sent after a response, in the socket before the next request goes, get that request a502withupstream-request-failedand never reach the guest. The tests send junk before a close, a whole response, bytes a while after the response, and a response in TLS records of its own behind the answer to a pipelined guest (TestC02HTTP1UpstreamJunkAfterResponse,TestC02HTTP1UnsolicitedResponse,TestC02HTTP1LateUnsolicitedResponse,TestC02HTTP1PipelinedLateBytes). A last read before a request that stalled past its deadline with bytes in the socket is made again, and the request gets that502when each try stalls (TestC02HTTP1ProbeStall). Bytes the next read takes without data pass (TestC02HTTP1ProbeRecordWithoutData), and a failed count of the socket’s bytes fails closed (TestC02HTTP1ProbeUnreadFails). A response head past its bound gets a502, and a response body that pauses past its bound resets (TestC02HTTP1ResponseTimeouts). A stream reset while it waits for a response head ends with the reset alone, with no502(TestC02HTTP1ResetWaitingForHead). - An HTTP/1.0 guest that asked to keep the stream gets a body of
unknown length unframed, and the stream closes after it
(
TestC02HTTP1HTTP10Unframed). A body that the body step made longer than its length resets withhttp-transfer-codingbefore the upstream has a whole request (TestC02HTTP1BodyLength). A body step’s read that returns bytes with a refusal sends none of them (TestC02HTTP1BodyRefusalSendsNothing). - Each stream registers one recompute check. A recompute that no
longer allows the request in flight resets the stream inside its
response, and one between requests doesn’t (
TestC02HTTP1Recompute). A check that fails at its registration resets with nothing sent upstream (TestC02HTTP1OpenCheckRefuses). That covers a recompute between the steps and the registration on a first request (TestC02HTTP1RecomputeBeforeAddCheck) and a nil check from the policy step (TestC02HTTP1NilOpenCheck). - A recompute that lands between the steps of a later request and
its going in flight resets the stream with the failed check in its log
record. The origin gets the earlier request only
(
TestC02HTTP1RecomputeBeforeWatch). - An allowed WebSocket upgrade relays (
TestC02HTTP1WebSocket). An upstream101to another request, or one answered with anotherUpgrade, resets withhttp-tunnel(TestC02HTTP1Unexpected101). FuzzHTTP1Connfeeds the loop any guest bytes and any upstream bytes under a policy step that passes or refuses every request. It checks that the loop returns with the stream ended. The upstream connection may open only after a request passed the steps, and no more requests may go upstream than passed. Each of them has the binding’sHost. A byte after them is a fault unless it belongs to a WebSocket.
Status: Draft