Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 16:46
· 24 commits to main since this release
0ee8f64

mimicry v0.5.0

This release adds Brave on macOS, Windows and Linux, and Chrome 157 on macOS. Real ECH is now sent to sites that publish an ECH config. You can now use client certificates and https:// and SOCKS4 proxies. HTTP/3 can run through CONNECT-UDP proxies, TLS tickets can be saved and loaded, and a TLS key log can be written. The repository also has the first Python and Node SDKs, built from source and not yet published.

New profiles

  • brave-157-macos, brave-157-windows and brave-157-linux (profiles.BraveMacOS(), profiles.BraveWindows(), profiles.BraveLinux(); pinned as profiles.Brave157MacOS() and so on). Brave 1.99.55 (Chromium 157) was captured on each platform, with nothing inherited (decision 0067). On the wire Brave is:

    • Edge's TLS hello with Chrome's HTTP/2 preface;
    • Chrome's user agent with the Brave brand, sec-gpc: 1, and fewer client hints (all 157.0.0.0);
    • Shields, as profile rules:
      • the Accept-Language q value is farbled per site (profile.Context.AcceptLanguageQ);
      • third-party cookies are partitioned;
      • a cross-site beacon is refused with the new ErrBlocked (profile.Context.BlocksCrossSiteBeacons), and nothing is sent;
    • HTTP/3 racing TCP after 2–5 ms. On a degrading QUIC path Brave moves after 4 PTOs on every platform, as Chrome and Edge do.

    (#109, #121, #140)

  • chrome-157-macos (profiles.Chrome157MacOS()). profiles.ChromeMacOS() now returns it. chrome-156-macos stays. (#124)

New API

  • Config.Tickets (*TicketCache, from NewTicketCache()) keeps TLS and QUIC session tickets. Every Transport given the same cache shares them, as a browser's tabs do. WriteJSON and ReadJSON carry an identity's sessions to another process, so its first connections resume; Clear forgets them all.

    • A cache belongs to one browser: NewTransport refuses a profile of another browser, and ReadJSON refuses another browser's tickets.
    • Through a proxy, tickets are filed under a hash of the proxy URL, credentials included. The URL itself never goes in the saved file.
    • Chrome 156 and Firefox 159 keep tickets in memory only, so a loaded cache models a browser that stayed open (decision 0062).
    • Without the field nothing changes: each Transport keeps its own cache.

    (#103, #113)

  • Config.KeyLogWriter receives every connection's TLS secrets in NSS key log format: TCP, QUIC and WebSockets, and an https:// proxy's TLS too. Captures can then be decrypted in Wireshark. Nothing changes on the wire, and mimicry never reads SSLKEYLOGFILE (decision 0061). (#107, #112)

  • Config.GetClientCertificate answers a server that asks for a client certificate (mutual TLS), as Chrome, Edge, Brave and Firefox 159 send one (decision 0064). Profiles hold what each browser does in the new tls.clientAuth section (profile.ClientAuth):

    • signatures: the certificate is signed with the browser's scheme. Over TLS 1.2 with RSA, Chrome and Edge use PKCS#1 and Firefox uses PSS;
    • resumption: Chrome and Edge resume such a session without sending the certificate again. Firefox never resumes it;
    • restart: Chrome and Edge drop the first connection to each host and port after its CertificateRequest and send the request again on a new connection. The Transport does the same, once per host and port;
    • no coalescing: a connection that carries a certificate takes no other host's requests;
    • over HTTP/3: a server that asks over HTTP/3 moves that origin's requests to TCP.

    Profiles without tls.clientAuth (Safari, the iPhone profiles, chrome-155-macos, Firefox 158) fail with ErrNotMeasured. Without the field, a server that asks gets an empty certificate list. (#108, #116)

  • https:// proxies in Config.Proxy, as Chrome, Edge, Brave and Firefox 159 use them (decision 0065):

    • TLS to the proxy uses the profile's own hello;
    • CONNECT goes over HTTP/2 (one connection, one stream per tunnel) or HTTP/1.1, whichever ALPN picks;
    • a 407 is answered with the URL's credentials;
    • sessions to the proxy resume where the browser resumes them;
    • RootCAs, Pins, VerifyConnection and KeyLogWriter apply to the proxy's TLS too. GetClientCertificate does not.

    This is for https:// requests only. Profiles without the new proxy.https section refuse it, Safari's and the iPhone's among them. (#105, #119)

  • socks4:// and socks4a:// proxies, as each browser sends them (decision 0063, profile section proxy.socks4):

    • Chrome 156/157, Edge and Brave send SOCKS4 only. The host is looked up here, as the browser does, so socks4a is refused for them;
    • Firefox 159 sends both;
    • Safari 26/27 on macOS send the host name only, so socks4 is refused for them.

    The iPhone profiles, chrome-155-macos and Firefox 158 fail with ErrNotMeasured. With Config.DialContext set, a socks4 target's host name is refused unless Config.Resolver has its own Dial. Otherwise the lookup would bypass your dialer. Nothing goes through SOCKS4 over HTTP/3. (#106, #115)

  • Config.ConnectUDPProxy (func(proxy *url.URL) (*url.URL, error), nil by default) lets requests through an http:// or https:// proxy use HTTP/3, carried by CONNECT-UDP (RFC 9298, MASQUE). It maps each proxy to its CONNECT-UDP endpoint, often a separate host and port at the provider. Return nil to keep that proxy's requests on TCP.

    • Inside the tunnel the profile's QUIC is unchanged, with one proxy connection per site QUIC connection.
    • A proxy that refuses is remembered, and its requests stay on TCP. Safari profiles stay on TCP too.
    • No browser does this, so it is opt-in (decision 0066). It was tested against a CONNECT-UDP proxy in the harness, not against a real provider.

    (#104, #120)

Behaviour changes

These don't change the API, but a request can now go out differently than in v0.4.0:

  • Real ECH where a site publishes a config (decision 0068). The Chrome 157, Edge 157, Brave 157 and Firefox 159 profiles now carry tls.realEch. That includes the defaults behind:

    • profiles.ChromeMacOS() and profiles.ChromeLinux();
    • profiles.EdgeMacOS() and profiles.EdgeWindows();
    • profiles.FirefoxMacOS(), profiles.FirefoxWindows() and profiles.FirefoxLinux().

    These profiles look up the DNS HTTPS record of each host they connect to directly. To a host whose record carries an ECH config, they send real Encrypted Client Hello as the browser does: its choice of config and HPKE suite, its own inner hello, and its reconnection when the server rejects ECH. Before, every server got the GREASE extension.

    • The lookup: one HTTPS query per new host and port, cached by TTL. It goes through Config.Resolver's Dial when the Resolver has one. Otherwise it is plain DNS to the system's nameservers. The handshake waits for it, for up to 5 s.
    • When nothing is looked up:
      • with Config.DialContext set and no Resolver.Dial, nothing is looked up and every server gets GREASE;
      • through any proxy, and on QUIC, mimicry sends GREASE as before;
      • a WebSocket's own HTTP/1.1 connection also gets GREASE.
    • A config list that doesn't parse: Chrome, Edge and Brave fail the request with no connection. Firefox sends its usual hello.
    • HTTP/3: on Chrome and Firefox for macOS, a response over an ECH-accepted connection teaches no Alt-Svc, so that host stays on TCP with ECH.
    • To opt out, use a profile without the section: p.With(func(s *profile.Spec) { s.TLS.RealECH = nil }). There is no Config field to turn it off, as a browser has no such setting.
    • Unchanged profiles: Safari 27 on macOS ignores the configs and looks nothing up. chrome-156-* (including profiles.ChromeWindows()), chrome-155-macos, Firefox 158, Safari 26 and the iPhone profiles keep GREASE.

    (#102, #124; uTLS fork v1.8.3)

  • profiles.ChromeMacOS() now returns chrome-157-macos instead of chrome-156-macos. Use profiles.Chrome156MacOS() to keep the old one. (#124)

Language bindings

Python and Node reach mimicry through mimicry-core (cmd/mimicry-core). It is a static Go binary (CGO_ENABLED=0) that each host process starts as its own child, and the SDK talks to it over a framed, multiplexed protocol whose messages are protobuf (decision 0069). The schema is in proto/mimicry/v1/mimicry.proto. Both SDKs use Go's names in each language's casing. They cover:

  • streamed bodies with backpressure, and cancellation;
  • WebSockets;
  • VerifyConnection;
  • typed errors that follow Go's errors.Is/errors.As;
  • saving and loading cookies, tickets and Alt-Svc.

Harness tests check that requests through the core, the Python SDK and the Node SDK are byte-identical to the Go client's.

  • Python (bindings/python): import mimicry for the sync API or mimicry.aio for asyncio. Needs Python 3.11 or later. The SDK is fork-safe: a child starts its own core.
  • Node (bindings/node): a Promise API with ReadableStream bodies and AbortSignal cancellation. Needs Node 22.12+ or 24+.

Not published in this release. Both SDKs are in the repository under bindings/, and you build them from source: see the Development section of each SDK's README. Neither is on PyPI or npm yet. The package name mimicry-http is provisional. Publishing is tracked in #130. (#111, #125, #131, #132, #134, #135, #138)

Profiles and tooling

  • New profile sections, all derived by hellogen from new captures and never hand-edited:

    • tls.clientAuth;
    • tls.realEch;
    • proxy.https;
    • proxy.socks4.

    (#115, #116, #119, #124)

  • Capture tooling:

    • Brave launcher and cmd/refresh targets;
    • the release watch follows Brave;
    • Linux browsers run in their own process group.

    (#121)

  • h3gen now places a path move after the last probe the browser sent before it. Brave on macOS and Windows go from afterPtos 3 to 4. (#140)

  • Module:

    • go 1.27.4 (was 1.27.3);
    • the uTLS fork is now the tagged github.com/roachadam/utls v1.8.3;
    • new requirements google.golang.org/protobuf (the bindings' core) and github.com/bufbuild/protocompile (its schema tests).
  • Tests and CI:

    • the HTTP/3 replays wait for the state they compare;
    • loss-driven ACKs are left out of the ACK cadence check;
    • CodeQL action bump.

    (#118, #123, #139, #141)