You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: two end-to-end bugs blocking filterRequest + ephemeral CA (#260)
* fix(network): updateConfig() throws DataCloneError when filterRequest is set
structuredClone cannot clone functions. When the consumer passes a
network.filterRequest callback (introduced in #258), the deep-clone in
updateConfig() throws DataCloneError. Callers that catch the throw end up
with config never set, so initialize() runs with no config and the proxy
falls through to opaque tunnelling instead of TLS termination.
Pull filterRequest out before cloning and restore the reference after —
a function reference is immutable in the sense the clone is protecting
against.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(terminating-tls): leaf AKI mismatched ephemeral CA's SKI → chain verify failed
node-forge's getExtension('subjectKeyIdentifier').subjectKeyIdentifier
returns a hex string for in-memory forge-created certs (e.g. the
ephemeral CA from #259) but raw bytes for certs parsed from PEM (e.g. a
user-supplied CA). Passing the hex string as authorityKeyIdentifier's
keyIdentifier caused the leaf's AKI to be the ASCII bytes of the hex
string, which doesn't match the CA's SKI — chain verification fails with
'unable to get local issuer certificate'.
AKI is optional; issuer/subject DN match is sufficient for chain
building. Drop the extension. Regression test: `openssl verify` against
both the fixture CA and an ephemeral CA.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* test(terminating-tls): end-to-end curl through proxy with ephemeral CA
Regression for the AKI fix: same curl-through-proxy round-trip as the
fixture-CA describe, but with createMitmCA({}). curl --cacert points at
the ephemeral CA's certPath; would fail 'unable to get local issuer'
without the AKI fix.
Also: agent:false on the proxy's outbound https.request. A proxy's
outbound leg shouldn't share the process-global connection pool; this
also documents (without fixing — it's process-wide) a Bun quirk where
the first request's `ca:` value sticks. The test sidesteps that by
using the fixture CA for the upstream leg in both describes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments