Skip to content

Releases

2.3.7

Choose a tag to compare

@github-actions github-actions released this 24 Nov 16:52
bca9c3f

Sōzu 2.3.7 fixes worker upgrades and shutdown, HTTP/1 and HTTP/2 connection handling, WebSocket teardown, and TCP and UDP listener accounting. Building from source now requires Rust 1.95.0.

Full changelog

2.3.6

Choose a tag to compare

@github-actions github-actions released this 18 Nov 16:22
c609809

Security

  • libz-sys moves from 1.1.31 to 1.1.33 for RUSTSEC-2026-0544, a heap buffer overflow in zlib's gz_vacate(); it reaches sozu-lib through flate2. The sozu-e2e Kafka test now speaks the Kafka protocol through kafka-protocol instead of rskafka, which depends on the unmaintained chrono (RUSTSEC-2026-0543); chrono leaves the lockfile and cargo audit --deny warnings passes again (#1928).

Fixed

  • The PROXY protocol v2 header Sōzu prepends to UDP datagrams (send_proxy_protocol, first datagram or every datagram with proxy_protocol_every_datagram) now names the address the client contacted as its destination, the UDP listener's address and port, as the specification defines it and as the TCP header always did. It named the backend the datagram was forwarded to: a capture against a production load balancer on 2026-11-17 showed destination 10.101.0.6 (the backend node) over UDP and the load balancer's public IP over TCP. The source, the real client address, was and stays correct. A listener bound to a wildcard address (0.0.0.0 or ::) advertises that wildcard IP with the listener port, because Sōzu does not read a datagram's real destination from the packet (IP_PKTINFO); bind the listener to the address clients reach when a backend needs the destination IP. Library API: ManagerInput::ClientDatagram gains a dst field, which breaks code that builds it (#1927).

2.3.5

Choose a tag to compare

@github-actions github-actions released this 18 Nov 14:52
768fad4

Security

  • A frontend HTTP/2 stream that Sōzu resets now gives its stream slot back at once. A stream error the client provokes (a malformed request such as a :path carrying a fragment, a body that does not match its content-length, a zero-increment or overflowing WINDOW_UPDATE, a stream made to depend on itself, DATA or HEADERS on a half-closed stream) is answered with RST_STREAM. The stream left the connection's stream table but kept its slot and its two pool buffers until the connection closed. With the default max_buffers = 1000, about 499 such resets on one connection emptied the worker's buffer pool. From then on the worker refused new streams with REFUSED_STREAM for want of buffers, on that connection and on a new connection alike, until the connection closed. The reset now logs the request and recycles its slot, whatever state the stream was in. Access-log timing changes with it: each provoked reset of a request not yet logged now writes its access-log line when the reset happens, so a request rejected at its HEADERS (a malformed :path), or reset after a default answer, is logged H2::Reset at once, where it used to be logged session close when its connection closed. A request reset while waiting for or linked to a backend was already logged H2::Reset, and still is, once. Debug builds now assert after every frame and every read and write pass that no frontend slot is left out of the stream table without being recycled (#1922).

  • A request answered 504 by a timeout no longer leaves its backend connection able to answer another request. On an HTTP/2 frontend the connection outlives the 504, and the client's next request could receive the late response of the request that timed out. Two paths led there, both with an HTTP/1.1 backend that had received the whole request and not answered yet. When back_timeout fired first (the default order, 30 s against a front_timeout of 60 s), the backend connection was returned to the session's keep-alive pool with that request still unanswered on it, so the next request of the session for that backend was written behind it and read its response. When front_timeout fired first (a back_timeout longer than front_timeout), the backend connection, HTTP/1.1 or HTTP/2, stayed attached to the stream slot: the next request reused the slot and received whatever the backend sent later, and a late read or close on a slot the session had since dropped indexed past the stream table and panicked. The mix-up stays inside one client connection, so it crosses users only where an intermediary multiplexes several of them onto it. Both timeout branches of Mux::timeout_inner now end the request on its backend before they install the answer: the HTTP/1.1 connection is closed instead of pooled or left attached, and an HTTP/2 backend stream is reset. A backend that had answered whole is still pooled. An HTTP/1.1 frontend closes after the default 504 (Connection: close) and was not affected with the default answers (#1924).

2.3.4

Choose a tag to compare

@github-actions github-actions released this 04 Nov 10:19
2.3.4
072b610

Added

  • BREAKING (library API). path_type = "REGEX_PATH" (CLI --path-regex-path, PathRuleKind::REGEX_PATH = 3) matches a regex, anchored at both ends, against the request path up to its first ? only, the Gateway API HTTPRoute RegularExpression path match. REGEX keeps matching the path together with its query string, so /api/.+ matches /api/?x=1 under REGEX but not REGEX_PATH, and ^/api/v2$ matches /api/v2?x=1 only under REGEX_PATH. It ranks as REGEX does. With rewrite_path, its $PATH[n] captures come from the path alone and the original ?query is appended to a rewritten path that has no ? of its own; a redirect Location follows it. REGEX, PREFIX and EQUALS are unchanged. Library API: PathRule::from_cli_options (sozu-command-lib) takes a fourth path_regex_path argument, and PathRule (sozu-lib) and PathRuleType (sozu-command-lib) gain a RegexPath variant, which breaks exhaustive matches on them. A worker that predates the kind refuses such a frontend as an invalid path rule, so upgrade every worker before declaring one (#1909).

  • An HTTP listener can serve cleartext HTTP/2 by prior knowledge with the new opt-in h2c_prior_knowledge option (HttpListenerConfig field 38, UpdateHttpListenerConfig field 44; TOML h2c_prior_knowledge = true; CLI sozu listener http add --h2c-prior-knowledge, sozu listener http update --h2c-prior-knowledge / --no-h2c-prior-knowledge). A connection whose first 24 bytes are the HTTP/2 connection preface is served as an HTTP/2 frontend, as an HTTPS connection that negotiated h2 through ALPN is, with the listener's H2 flood thresholds and tuning; every other connection stays HTTP/1.x. The first bytes are peeked, never consumed: a strict prefix of the preface waits for more bytes within request_timeout, and a diverging byte decides HTTP/1.x. A client that sends nothing, or only part of the preface, before request_timeout is closed without the 408 an HTTP/1-only listener answers. The scheme stays http (:scheme, X-Forwarded-Proto, Forwarded: proto), the option composes with expect_proxy, and Upgrade: h2c remains unsupported. Such a listener is held to the H2 minimum buffer_size (16393) at configuration load, like an HTTPS listener advertising h2. Off by default: without it a preface is answered 400 Bad Request as before. The use case is cleartext gRPC, e.g. the Kubernetes Gateway API GRPCRoute. New metrics http.h2c.prior_knowledge (connections served as h2c) and http.upgrade.h2c.failed. A listener update applies to new connections only (#1911).

Fixed

  • A worker now leaves its event loop when its command channel reports an error, as it already did on a hang-up. The main process closing the channel with a worker answer still unread resets the connection, which the worker used to log and ignore, so it kept running with nothing left to drive it and a caller joining its thread waited forever (#1912).

  • An HTTP/1.1 backend now receives a single Host header when a frontend sets rewrite_host. The router added a Host header block on top of the rewritten authority, which the HTTP/1.1 converter already writes as Host, so the backend saw two, and servers that refuse a duplicate Host (Go's net/http) answered 400. A frontend request header named Host now replaces the request authority instead of adding a second, different Host line; rewrite_host still takes precedence over it, and an HTTP/2 backend now receives that value as :authority where the header was previously dropped (#1908).

  • A fast HTTP transfer is no longer cut at a random offset. When the inner loop of Mux::ready_inner reached MAX_LOOP_ITERATIONS (10,000) in one ready() call, it closed the session unless output was still queued, even if every iteration had forwarded bytes. When the client and the backend both kept up for that many iterations (about 160 MiB with 16 KiB buffers), the client saw a clean close in the middle of a Content-Length body ("Premature end of Content-Length delimited message body"), with http.infinite_loop.error incremented and, before 2.3.0, no log at the default level. Downloads and uploads over plaintext and TLS HTTP/1.1 were measured exposed, and the listener's ALPN list played no part; HTTP/2 frontends run the same loop. A call that reaches the budget after forwarding at least one stream byte per budgeted iteration to either peer (Context::stream_bytes_out) now yields: it keeps its readiness, counts the new http.mux.loop_budget_yield counter, and the worker resumes it after its next poll, which does not block while a session is queued (ProxySession::yielded, Server::resume_yielded_sessions). A fast transfer neither is cut nor holds the single-threaded worker past one budget per turn. A call that forwarded nothing keeps the existing http.infinite_loop.error path. Reproduced deterministically by a_transfer_progressing_at_the_loop_limit_yields_and_resumes_without_a_new_event, and end to end in large_response_tests.rs (256 MiB over loopback: 4/40 plaintext and 5/60 TLS downloads, 10/20 TLS uploads cut on main). ProxySession gains a yielded method with a default false, so other implementors are unaffected (#1906).

  • A response in progress is no longer cut by the timeout of the peer that is not holding it up. back_timeout fired while Sōzu itself had stopped reading the backend because a slow client left response bytes queued, and cut the response (backend_response_timeout); front_timeout fired while a client that had taken every byte waited on a slow backend, and closed the session silently, because kawa's is_completed (nothing queued) was read as "response fully proxied". Each timeout now defers to the other while the response waits on the other peer (response_waits_on_client); the two conditions are complementary, so a client that stops reading still meets front_timeout and a silent backend still meets back_timeout. Reproduced end to end with 4 s pauses against 2 s timeouts, cut at 4.0 and 6.0 of 8 MiB before the fix (#1906).

Upgrade notes

  • The command schema gains PathRuleKind::REGEX_PATH = 3 and the optional h2c_prior_knowledge fields (HttpListenerConfig field 38, UpdateHttpListenerConfig field 44). Configuration and saved state written by 2.3.3 load unchanged. Upgrade the main process and every worker before declaring a REGEX_PATH frontend or enabling h2c_prior_knowledge: a worker that predates them refuses a REGEX_PATH frontend as an invalid path rule, and ignores the unknown h2c_prior_knowledge field, so it keeps answering a preface 400 Bad Request. A main-only replacement does not qualify the transition. The release gate exercises the published 2.3.3 binary with two workers, saved state and HTTP/HTTPS/TCP/UDP traffic before, during and after replacement. Existing 2.2.1 and 2.3.1 compatibility cases remain separate.
  • Library API: PathRule::from_cli_options (sozu-command-lib) takes a fourth argument, and PathRule (sozu-lib) and PathRuleType (sozu-command-lib) gain a RegexPath variant. ProxySession (sozu-lib) gains a yielded method whose default returns false, so other implementors are unaffected.

2.3.3

Choose a tag to compare

@github-actions github-actions released this 19 Oct 21:30
6c983b6

Changed

  • Ordinary worker requests and SetMetricDetail no longer compute full-config invariant hash snapshots in non-debug release builds. Debug assertions still retain this coverage, and legitimate query hashes are unchanged.

Fixed

  • Partial cluster and certificate-worker queries now answer Failure on timeout, refusal, incomplete or invalid worker responses, rather than a partial Success. This includes a certificate fingerprint query refused by a worker that does not hold the certificate.
  • The debug ConfigState diff postcondition now compares TCP frontend membership rather than Vec order. Storage and emission are unchanged.

Upgrade notes

  • The command schema, configuration and saved-state formats are unchanged from 2.3.2. Upgrade the main process and every worker; a main-only replacement does not qualify the transition. The release gate exercises the published 2.3.2 binary with two workers, saved state and HTTP/HTTPS/TCP/UDP traffic before, during and after replacement. Existing 2.2.1 and 2.3.1 compatibility cases remain separate.

2.3.2

Choose a tag to compare

@github-actions github-actions released this 18 Oct 18:08
2.3.2
c4b00f9

Added

  • BREAKING (library API) — feat(health-check): probe port. HealthCheckConfig gains an
    optional port (proto field 9): when set, both HTTP and TCP probes connect to the
    backend's IP address on that port instead of its data port, and the HTTP probe's Host
    (h2c :authority) names that ip:port. Unset, the probe dials the data port as before. It
    serves backends whose health endpoint or companion listener lives on another port, as
    UdpHealthConfig.tcp_port already does for UDP clusters. validate_health_check_config
    refuses a port outside 1..=65535 at the CLI, the TOML loader, the master state and the
    worker. New TOML key port in [clusters.<id>.health_check] and sozu cluster health-check set flag --port; sozu cluster health-check list gains a port column (data when
    unset). port targets a backend IP address: it is refused, with a stable error, when a
    backend of the cluster has a unix_path, in either order and in the TOML loader (DNS-expanded
    entries included), the master state and the worker; a unix_path backend without port is
    probed through its UNIX socket. Library API: HealthCheckConfig and FileHealthCheckConfig gain the public field
    port, so a struct literal must name it (only the protobuf HealthCheckConfig also accepts ..Default::default()). A message or saved
    state without the field decodes as before. port is an additive field 9 on the existing
    AddCluster and SetHealthCheck messages, so it is not fail-closed: a worker older
    than 2.3.2 decodes the message, ignores the unknown field and probes the data port. Upgrade
    the main process and every worker to 2.3.2 before enabling port. Rust source: an
    exhaustive HealthCheckConfig or FileHealthCheckConfig literal must name port
    (Option<u32> in both).

    Before enabling it. Upgrade the main process and every worker, and use the new CLI,
    before setting port: an older worker ignores field 9 and probes the data port, which in
    TCP mode passes every backend accepting connections there; an older sozu CLI that
    patches a cluster by read-modify-write (sozu cluster h2 enable|disable) drops it, and so
    does an older binary loading the saved state. Documented in doc/health_checks.md,
    doc/configure.md and doc/configure_cli.md; covered by
    test_health_check_tcp_mode_probe_port_closed_marks_serving_backend_down,
    test_health_check_http_mode_probe_port_closed_marks_serving_backend_down,
    test_health_check_tcp_mode_probe_port_answering_keeps_backend_up and
    test_health_check_http_mode_probe_port_answering_keeps_backend_up
    (e2e/src/tests/health_check_mode_tests.rs),
    probe_address_replaces_only_the_port_when_one_is_set (lib/src/health_check.rs),
    set_health_check_out_of_range_port_rejected and
    a_health_check_port_and_a_unix_backend_never_share_a_cluster (command/src/state.rs),
    a_health_check_port_and_a_unix_path_backend_never_share_a_file_cluster
    (command/src/config.rs), probe_dials_the_probe_port_not_the_data_port,
    unix_backend_without_probe_port_is_probed_through_its_socket (lib/src/health_check.rs) and
    a_probe_port_already_set_refuses_a_unix_backend and
    a_unix_backend_already_there_refuses_a_probe_port (lib/src/server.rs),
    diff_converges_when_a_probe_port_and_a_unix_backend_swap (command/src/state.rs),
    a_static_reload_converges_when_a_probe_port_and_a_unix_backend_swap and
    a_load_state_converges_when_a_probe_port_and_a_unix_backend_swap
    (bin/src/command/requests.rs), plus unit tests in
    command/src/config.rs and bin/src/cli.rs.

  • HTTP and HTTPS frontends can route on request headers
    (#1253). The new
    header_predicates list of a frontend (RequestHttpFrontend field 17, TOML
    header_predicates = [{ name, match, value }], CLI --match-header <match>=<name>[=<value>]) holds conditions that must all be true: exact
    (byte-equal value), regex (anchored at both ends) or present. Names are
    case-insensitive; Host and Cookie are refused. For one hostname, a
    frontend whose predicates hold outranks every frontend without predicates,
    so a canary and its base can share a hostname and path in any declaration
    order. Predicates are part of the frontend's identity, so a removal names
    them too. Frontends without predicates route as before, and the command
    schema change is additive: saved states without the field load unchanged.
    A frontend with predicates travels on dedicated request verbs
    (AddHttpFrontendWithHeaderPredicates & co) that a worker predating the
    feature cannot decode, so it fails the request instead of installing the
    route without its guard; frontends without predicates keep the historical
    verbs. Repeated identical predicates canonicalize to one identity, a TCP
    frontend rejects header_predicates instead of ignoring them, and frontend
    listings show a redacted predicate count rather than names or values.
    Protobuf: RequestHttpFrontend field 17 and Request fields 66-69
    (AddHttpFrontendWithHeaderPredicates, RemoveHttpFrontendWithHeaderPredicates,
    AddHttpsFrontendWithHeaderPredicates, RemoveHttpsFrontendWithHeaderPredicates).
    Rust source: RequestHttpFrontend, HttpFrontendConfig and
    FileClusterFrontendConfig gain the public field header_predicates, so an
    exhaustive struct literal must name it (the protobuf RequestHttpFrontend also accepts ..Default::default());
    request::RequestType gains the four verbs above, so an exhaustive match
    must handle them; ConfigError::InvalidHeaderPredicate { index, reason } is
    new, so an exhaustive match on ConfigError must handle it.
    command::response::HttpFrontend also gains the public field
    header_predicates: Vec<HeaderPredicate>;
    FileClusterFrontendConfig::header_predicates is an
    Option<Vec<HeaderPredicateConfig>>, and HeaderPredicateConfig is a new
    public type (sozu_command_lib::config).
    sozu_lib::router::Router::tree now holds
    (PathRule, MethodRule, HeaderRules, Route) tuples instead of
    (PathRule, MethodRule, Route), and sozu_lib::router::RouterError gains
    InvalidHeaderPredicate { index, reason }, so an exhaustive match on it
    must handle it.

  • feat(mux): redirect = "silent_close" refuses a request without any
    response
    (#767), the
    equivalent of nginx's return 444. A new RedirectPolicy::SILENT_CLOSE = 5
    (appended to the protobuf enum; TOML redirect = "silent_close", CLI
    --redirect silent_close) makes an HTTP/1.x frontend close the connection
    without writing a byte and an HTTP/2 frontend reset only the refused stream
    with RST_STREAM(CANCEL), leaving the connection's other streams running. The
    backend is never contacted, whether or not the frontend names a cluster, and
    the policy wins over the frontend's other redirect, rewrite and authentication
    settings. The access log records status 444 with message silent_close; the
    line is not an error (http.errors is not incremented) and counts in
    http.status.4xx. The main sends a silent_close add as
    AddHttpFrontendWithSilentClose (field 70) or
    AddHttpsFrontendWithSilentClose (field 71); other frontends keep the legacy
    verbs. A worker older than 2.3.2 cannot decode these requests and fails them,
    so it never installs an unguarded forwarding route. Rust source:
    RedirectPolicy gains SilentClose, request::RequestType gains
    AddHttpFrontendWithSilentClose and AddHttpsFrontendWithSilentClose, and
    sozu_lib::RetrieveClusterError gains SilentClose, so an exhaustive match
    on any of them must handle the new variants.

  • Backends reachable over UNIX domain sockets
    (#152). A backend's new
    unix_path (configuration file, AddBackend.unix_path in the protocol,
    sozu backend add --unix-path) takes an absolute path or a Linux
    abstract-namespace @name; HTTP, HTTPS and TCP clusters dial it instead of
    address, which stays the backend's identity and must be unique in its
    cluster. Health checks probe the same socket. UDP is not supported: the
    configuration file and the main process's state both refuse it there.
    A UNIX backend travels on a new AddUnixBackend request
    (RequestType::add_backend picks the verb, and the main process rewrites
    every fan-out to it): a main process or worker that predates it cannot decode
    that request, so it never registers the backend or dials address over TCP.
    A client that sends unix_path on the historical AddBackend instead is
    outside this guarantee: an older decoder drops the field. Protobuf: AddBackend field 7
    (unix_path) and Request field 72 (AddUnixBackend). Covered by
    command/tests/unix_backend_verb.rs and the test_*unix* e2e tests
    (e2e/src/tests/unix_backend_tests.rs). Rust source: AddBackend and
    BackendConfig gain the public field unix_path (as does the new FileBackendConfig), so
    an exhaustive struct literal must name it (the protobuf AddBackend also accepts ..Default::default());
    request::RequestType gains AddUnixBackend, so an exhaustive match must
    handle it; ConfigError::InvalidBackendUnixPath { cluster_id, address, reason }
    is new, so an exhaustive match on ConfigError must handle it.
    command::response::Backend and sozu_lib::backends::Backend also gain the
    public field unix_path: Option<String>, which an exhaustive struct literal
    must name.

  • A backend address in the configuration file may be a host:port as well
    as a socket address (#347). The name is resolved once, with the system
    resolver, when the file is loaded (at startup or by sozu reload --file);
    it is never re-resolved while running. Each distinct resolved address
    becomes a backend with a deterministic id, `<backend_id>-

    ...

Read more

2.3.1

Choose a tag to compare

@github-actions github-actions released this 14 Oct 21:49
1cc9bf2

Fixed

  • A worker whose HTTP, HTTPS, TCP or UDP proxy refused a frontend addition or
    removal could keep a ConfigState that disagreed with the runtime. When
    every worker refused the order, the main process could then disagree with
    the workers too. Workers now apply the same compensating path as the main
    process before returning the failure. Adds use their request-only inverse;
    removals snapshot the matching stored frontend so tags, method, path,
    position and routing policy are restored exactly. Listener additions use
    the request-only path. Upserts, listener updates, cluster removals and
    certificate mutations remain outside this compensating path because they
    need a distinct snapshot of the displaced value or runtime state. HTTP and
    HTTPS frontend changes that target several same-address listeners can also
    leave a pre-existing heterogeneous runtime only partially changed when one
    listener refuses the order; this fix restores ConfigState, but it does not
    reconstruct that runtime-only state.

Upgrade notes

  • This patch does not change the command schema, configuration format or saved
    state format. A 2.3.0 main and its workers can hot-upgrade to 2.3.1.
  • The first migration from 2.2.1 under the shipped Type=notify systemd units
    still requires a controlled service restart with the deployment's normal
    drain and health checks. The legacy hot-upgrade path still refuses
    NOTIFY_SOCKET; removing the variable or changing the unit is not a safe
    workaround. Deployments outside those units must follow the documented
    legacy-upgrade preconditions and verify every worker, routing state and
    traffic.

This fix makes rejected frontend orders restore their recorded configuration
state. It does not make every Sōzu mutation transactional: mixed worker
acknowledgements, upserts, listener updates, cluster removals, certificate
mutations and pre-existing heterogeneous multi-listener runtime state retain the
limits above.

Compare 2.3.0 with 2.3.1.

2.3.0

Choose a tag to compare

@github-actions github-actions released this 14 Oct 17:11

Highlights

  • HTTPS listeners support mutual TLS, trusted client CAs, certificate revocation
    lists, and live policy reloads.
  • Backend health checks support TCP-connect probes and configurable accepted HTTP
    status ranges. Load balancing gains shuffle sharding and header/cookie affinity.
  • UDP clusters gain per-source flow limits, alongside reliability and resource
    accounting improvements across TCP, UDP, HTTP/1.1 and HTTP/2.
  • HTTP/2 scheduling, flow control, draining and flood mitigation are hardened.
  • The command socket mode is configurable, and the optional sozu top dashboard
    provides live operational visibility.
  • Main upgrades use transactional handoffs; worker-upgrade failures are reported
    explicitly. Dependencies are refreshed, and the minimum Rust version is 1.93.1.
  • rustls 0.23.46 includes the fixes for RUSTSEC-2026-0346 through
    RUSTSEC-2026-0349.
  • Rust crate packages build from clean source archives without special Cargo
    verification flags.

Upgrading from 2.2.1

The first migration under the shipped Type=notify systemd units requires a
controlled service restart, with the deployment's normal drain and health checks.

The legacy hot-upgrade path refuses NOTIFY_SOCKET; removing that variable or
changing the unit alone is not a safe workaround. Containers whose main has PID 1
must use their normal replacement procedure.

On supported Linux deployments outside those units, the legacy bridge requires
an idle control plane, the replacement CLI, and verification of every worker,
routing state and traffic. Follow the
migration procedure.

Compatibility

Review the detailed breaking-change entries before upgrading: the default
connection-attempt budget increases from three to five, and POWER_OF_TWO load
balancing and path_type = REGEX matching change. Several public library APIs
gain fields or change signatures; upgrade sozu-command-lib, sozu-lib and
sozu together. Upgrade the main, all workers and administrative clients before
enabling new cluster or listener features.

The complete changelog
below retains every detailed change. Compare 2.2.1 with 2.3.0.

2.2.1

Choose a tag to compare

@github-actions github-actions released this 28 Aug 14:54

Patch release: the main process validates listeners and HTTP/HTTPS
frontends before committing them to its state and rolls back unanimously
rejected or unacknowledged fan-outs, the router rejects malformed
frontend hostnames instead of panicking workers, and a full dependency
refresh re-enables TLS 1.2 + ECDSA under crypto-openssl.

🔐 Security

  • fix(command): redact TLS certificate and private-key material from Debug output.
    Certificate payloads, runtime certified keys and resolvers, HTTP(S) listeners and listener
    patches, HTTP frontend configuration, top-level Request/RequestType values, retained command
    tasks, and generated frontend requests now use bounded Debug summaries without exposing PEM
    contents, certificate DER, custom answer bodies, header values, string-valued command payloads,
    or other raw fields carried by those types through nested requests, retained state, or log
    statements that use Debug formatting. Direct log and failure projections now also replace
    certificate names, HTTP frontend keys, route-miss hosts/paths/custom methods, rewrites, cluster
    IDs, custom-answer keys, runtime SNI/ALPN/authority/certificate-SAN values, certificate
    fingerprints, and certificate-query domains and results with bounded addresses, kinds, counts,
    and byte lengths. StateError is bounded at its Display/Debug boundary before worker and
    audit sinks, and retained-task logs no longer delegate to concrete task payloads.
    Wire, Serde, JSON, raw retained state keys, raw StateError, RouterError, ListenerError, and
    RetrieveClusterError::SniAuthorityMismatch variant fields, RequestHttpFrontend::Display, and
    certificate-query response payloads remain unchanged.

🐛 Fixed

  • fix(router): reject a malformed frontend hostname instead of panicking the worker.
    TrieNode::insert asserted that its recursive insert never reports InsertResult::Failed, but
    the route-table grammar rejects a whole class of hostnames the two cheap guards above the assert
    let through: a host ending in / with no openable regex segment (example.com/), a regex
    segment that is not .-anchored (abc/[0-9]+/.example.com), a segment that is not a valid regex
    (/[/.example.com), and an empty label (.example.com). Those hostnames arrive from the control
    plane, so an AddHttpFrontend carrying one panicked every worker the main process fanned the
    request out to — and panicked them again on each restart state replay. add_tree_rule now
    surfaces the rejection as RouterError::AddRoute, so the worker answers Failure and stays up.
    Three sibling holes in the same input class are closed with it: convert_regex_domain_rule
    indexed one byte past the end of a hostname whose last segment is followed by a bare trailing
    . (/a/.) — a release panic reached through the unconditional DomainRule parse, upstream of
    the trie; hostnames are now bounded to MAX_HOSTNAME_LENGTH (4096 bytes) before any parse, since
    the trie recurses once per label (a ~100k-label hostname aborted the worker with an uncatchable
    stack overflow) and a /-segment compiles a control-plane-supplied regex whose compilation time
    grows with the pattern; and CertificateResolver::add_certificate now validates every
    certificate name against the same trie grammar up front — with the insert no longer panicking, a
    discarded InsertResult::Failed would have registered the certificate while the SNI trie never
    learned the name, silently failing every handshake for it.
    With workers answering Failure instead of dying, the unanimous-rejection rollback from
    #1301 also becomes reachable for this class on
    the live fan-out path, so the main process's ConfigState is reverted and no phantom route
    persists. Two replay holes remain open and are tracked as follow-ups: the LoadState path has no
    rollback at all (a poisoned saved state re-injects the entry and SaveState re-persists it), and
    the rollback is skipped when the scatter times out — a single unpatched worker panicking during a
    rolling upgrade commits the malformed entry permanently.

  • fix(command): validate a listener configuration before committing it to the main-process
    state
    (#1301). An HTTPS listener whose
    configuration the worker cannot build (an unusable TLS version/cipher set, or an unparseable
    answer template) was recorded in the main process's ConfigState before the worker rejected it,
    reserving the address; a corrected reload was then refused with StateError::Exists and never
    reached the workers, so the listener stayed down until an explicit RemoveListener or a restart.
    The main process now validates every Add{Http,Https,Tcp,Udp}Listener the way the worker builds
    it — reusing the worker's own construction check, before ConfigState is mutated and fanned out —
    so an invalid listener never reserves its address and a corrected reload applies cleanly. Invalid
    listeners in the static config or a loaded state file are likewise skipped without reserving their
    address. The StateError::Exists message now also points at the remedy (remove it first, or apply
    the corresponding update, instead of re-adding). As defense-in-depth, when a committed change is
    rejected by every worker it was fanned out to, the main process now reverts its own ConfigState
    with the inverse request (listener and HTTP/HTTPS-frontend adds), so its authoritative state — the
    one replayed into restarted and upgraded workers — never permanently holds an add the whole fleet
    refused.

  • fix(command): validate HTTP/HTTPS frontends before committing them to the main-process
    state
    (#1313). ConfigState has no
    route-grammar check — add_http_frontend only reparses the address and maps the position — so an
    Add{Http,Https}Frontend whose hostname every worker's router refuses was still recorded by the
    main process. That state is authoritative: SaveState re-serialised the malformed entry and every
    replay re-injected it, and the replay path (LoadState, static-config load) has no rollback at
    all, so the entry survived a unanimous worker rejection and poisoned each subsequent restart. The
    main process now runs the worker's own insertion path — the same Router::add_http_front, against
    a disposable empty router — before ConfigState is mutated, on all three apply paths: a live
    Add{Http,Https}Frontend is answered with a failure and never fanned out, and a malformed entry
    in a saved state file or the static configuration is skipped without entering the state, so it
    can never be re-persisted. Skipped entries (frontends and, as before, unbuildable listeners) are
    now reported at warn! instead of debug! — an entry silently dropped from the state the
    operator saved must be visible at the default log level — and a state load that skipped any
    entry says how many. Rejection messages report byte lengths only, never the operator-supplied
    hostname.

  • fix(command): roll back a fanned-out change when the scatter times out with zero worker
    acknowledgements
    (#1314). The unanimous-
    rejection rollback from #1301 required at least
    one worker to answer Failure, so it was skipped whenever the fan-out timed out instead — and a
    worker that panics answers nothing at all: it emits no synthetic Failure and no
    expected-response decrement, so the task can only end through its timeout. One unpatched worker
    panicking on a malformed frontend during a rolling upgrade therefore left the malformed entry
    committed in the main process's ConfigState forever, with SaveState re-persisting it, even
    though the operator was already told the command had failed. The revert now fires on either
    trigger — every scattered worker rejected the change, or the scatter timed out — as long as no
    worker acknowledged it; an entry at least one worker applied is still never reverted. Residual: a
    slow-but-healthy worker whose Ok arrives after the deadline is invisible to the finished task,
    so it keeps the frontend until its next restart or state replay while the main process reverts —
    a bounded divergence that self-heals on replay and matches the failure already reported to the
    client.

  • fix(command): report a fan-out timeout as a failure, not a success. handle_finishing_task
    passed a hard-coded timed_out = false into every task completion handler, so a command whose
    worker fan-out timed out was reported to the operator as Successfully applied request to all workers and its audit line mislabeled the FanoutStatus/result. The real timed_out flag is
    now forwarded, so a timed-out command correctly returns a failure (and the #1301 rollback
    safety-net's timeout guard now engages as intended).

🔄 Changed

  • chore: refresh every workspace dependency requirement to its latest published version
    (#1317). Cargo.toml requirements move to
    explicit ^x.y.z form: async-trait ^0.1.92, flate2 ^1.1.10, futures ^0.3.34,
    http-body-util ^0.1.5, log ^0.4.34, rustls-openssl ^0.4.0, and tui-big-text ^0.8.9,
    with both lockfiles regenerated (cargo audit reports no advisory; the transitive h2 0.4.19
    closing RUSTSEC-2026-0258 had already landed on main). rustls-openssl 0.4.0 fixes the
    TLS 1.2 + ECDSA handshake regression that 0.3.x carried, so test_tls_1_2_ecdsa runs under
    crypto-openssl again and that CI cell is back to full parity with the other providers.

2.2.0

Choose a tag to compare

@github-actions github-actions released this 16 Jul 09:13

Minor release: TCP passthrough routing by TLS SNI + ALPN, HTTP/1
Transfer-Encoding smuggling hardening, and frontend half-close data-loss
fixes across the pipe and splice paths.

✨ Added

  • feat(tcp): TCP passthrough routing by TLS SNI + ALPN (#1279).
    A protocol = "tcp" listener can now fan out to multiple clusters on the
    same address:port by reading the TLS ClientHello's SNI (RFC 6066 §3) and,
    per route entry, ALPN (RFC 7301 §3.1) during a bounded preread phase —
    without decrypting or terminating the connection; the backend still
    completes its own handshake with the untouched bytes. New TOML keys: TCP
    frontend hostname (mapped to the wire sni field; exact host or a single
    leading *. wildcard) and alpn (repeatable; empty is the per-(address, hostname) catch-all), and listener sni_preread_timeout (default 5s) /
    sni_preread_max_bytes (default 16384; config-load rejects a value above
    the global buffer_size, and the worker defensively clamps the effective
    cap to the session buffer at runtime). New CLI
    flags: sozu frontend tcp add|remove --sni <host> --alpn <proto> and sozu listener tcp add --sni-preread-timeout <secs> --sni-preread-max-bytes <bytes> (add-only — no wire support yet for patching either knob via
    listener tcp update). New metrics:
    tcp.sni_preread.{routed,active,duration} and eleven
    tcp.sni_preread.rejected.<reason> counters (not_tls, malformed_record,
    malformed_handshake, fragmented, too_large, no_sni,
    ech_outer_absent, sni_unmatched, alpn_unmatched,
    proxy_header_invalid, front_closed) plus
    tcp.upgrade.sni_preread.failed. A listener cannot mix SNI-scoped and
    no-SNI (legacy single-cluster) frontends; alpn requires hostname
    (ConfigError::AlpnWithoutSni — a no-SNI frontend would silently never
    enforce it); sni_preread_max_bytes must be >= 5 bytes, a full TLS record
    header (ConfigError::SniPrereadMaxBytesTooSmall — 0 would spin the
    preread shell on zero-progress reads). These routing-shape invariants (the
    mixing ban, ALPN-overlap/catch-all uniqueness, and ALPN-without-SNI) are
    now enforced BOTH at TOML config-load (command/src/config.rs) AND
    defensively on the worker's hot AddTcpFrontend path
    (TcpListener::validate_new_tcp_front, lib/src/tcp.rs), so a request
    sent directly over the command socket or replayed from a stale
    LoadState snapshot can no longer bypass config.rs and corrupt a
    listener's routing table. See doc/configure.md and
    lib/src/protocol/tcp_preread/LIFECYCLE.md for the full config surface and
    state lifecycle. New test coverage: unit tests in
    lib/src/protocol/tcp_preread/{mod,shell}.rs, e2e suite
    e2e/src/tests/tcp_sni_tests.rs, the fuzz_tcp_clienthello cargo-fuzz
    target (wired into the fuzz CI job — nightly toolchain, 300s per target
    on every push/PR — and simulation-sweep.yml's daily
    extended-fuzz matrix), and a moonpool-driven deterministic simulation
    (sim/tests/tcp_preread_sim.rs, sozu-sim crate — wired into both the
    per-PR udp-simulation CI job and a new nightly
    tcp-preread-simulation-sweep job in simulation-sweep.yml).

🔄 Changed

  • chore(deps): moonpool-sim tracks its published crates.io release.
    The sozu-sim dev-dependency moves from a pinned main git rev to ^0.8.0
    on crates.io, closing the follow-up 2.1.1 flagged when the then-published
    0.7.0 could not build on stable.
  • chore(deps): dependency refresh — http-body-util 0.1.3 → 0.1.4,
    mio 1.2.1 → 1.2.2, regex 1.12.4 → 1.13.0, rustls 0.23.41 → 0.23.42,
    socket2 0.6.4 → 0.6.5, toml 1.1.2 → 1.1.3.

🐛 Fixed

  • fix(pipe): stopped truncating in-flight bytes on a frontend half-close
    (surfaced by #1279). When the
    frontend read side reached EOF while frontend_buffer still held bytes
    queued for the backend, Pipe::readable returned Close unconditionally,
    silently dropping them instead of flushing first — any front-to-back tail
    still in flight at the exact moment of frontend close was lost. The
    reproducer that surfaced it was a request payload coalesced with the SNI
    ClientHello in the same read (TCP passthrough routing above), but the bug
    was general: any plain-TCP upload racing a frontend close could hit it.
    readable now transitions to the half-closed WriteOpen status (matching
    the existing WouldBlock/Continue handling), arms backend-writable to
    drain the queue, and defers the actual teardown to check_connections,
    which only closes once nothing is in flight. The HUP path had the same
    defect under a heavier load: EPOLLRDHUP can coalesce with the payload tail
    into a single epoll batch, so TcpSession::ready_inner observed HUP
    before its processing loop even ran and called Pipe::frontend_hup, which
    also returned Close unconditionally; it now drains in-flight request
    bytes the same way (Continue + backend-writable + retained frontend
    READABLE interest), and ready_inner falls through into its
    same-pass loop on that Continue instead of returning immediately, so the
    drain completes without waiting on a frontend event that — the client
    already sent FIN — will never arrive. The splice fast path's EOF arm
    (Pipe::splice_readable) had the same unconditional close, dropping bytes
    already spliced into the kernel pipe; it now defers teardown the same way
    until splice_backend_writable drains them.
  • fix(command): count_tcp_frontends_raw compiles unconditionally. The
    helper was gated #[cfg(debug_assertions)] while add_tcp_frontend
    references it inside debug_assert! expressions — which still typecheck in
    release builds even though they compile out — so the bench and release
    profiles (CI's Criterion step, the Docker image build) failed with E0599
    while every debug-profile gate stayed green (command/src/state.rs).
  • fix(packaging): the RPM spec Version tracks the release.
    os-build/linux-rpm/sozu.spec still declared 2.1.0 after the 2.1.1
    release. Its Source0 resolves …/archive/%{version}.tar.gz, so the stale
    value made the spec fetch the wrong source tarball; it is now bumped in
    lockstep with the crates.

🤖 CI

  • fix(ci): the release build uses the pinned MSRV toolchain. The
    per-target release job installs Rust 1.91.0 with its matrix target, matching
    the rust-toolchain pin (it still requested 1.88.0 after the MSRV bump).
  • fix(ci): the release preflight validates every crate version. The
    drift check covered bin/lib/command/e2e only, while sim/ (a
    workspace member) and the out-of-workspace fuzz/ track the same version, so
    a partially-bumped tree could ship a green preflight — which is why 2.1.1
    needed two follow-up commits to align fuzz/. The loop now covers all six
    manifests and RELEASE.md names them.
  • chore(e2e): sozu-e2e carries publish = false. The integration-test
    harness is not published to crates.io.

🔐 Security

  • fix(h1): harden HTTP/1 Transfer-Encoding framing (reopen of #726).
    HttpContext::on_request_headers (lib/src/protocol/kawa_h1/editor.rs) now
    answers 400 when a request carries a Transfer-Encoding header that the
    parser did not accept as chunked framing, rather than forwarding it alongside
    a Content-Length, and also when more than one non-elided Transfer-Encoding
    header survives kawa's header pass (kawa evaluates each TE field line
    independently, so a first chunked line can latch chunked framing while a
    second, differently-framed line rides along uncaught). Per RFC 9110 §7.6 /
    RFC 9112 §6.1 an intermediary must not forward ambiguous message framing. The
    rejection runs before routing and increments the
    http.frontend.transfer_encoding_smuggling metric; it mirrors the existing
    HTTP/2 → H1 framing-conflict rejection.

  • chore: update kawa to 0.7.1 — the complementary upstream parser fix.
    kawa 0.7.0 resolves Transfer-Encoding before Content-Length and applies
    RFC 9110 §6.3 / RFC 9112 §6.1 at the parser level: a present
    Transfer-Encoding now elides every Content-Length regardless of header
    order (previously only once chunked framing had been adopted), repeated
    Transfer-Encoding field lines combine with the last line deciding the final
    coding (so a leading chunked line no longer latches chunked framing on its
    own), and a request whose combined final coding is not chunked is rejected
    by the parser instead of forwarded.

    kawa 0.7.1 (CleverCloud/kawa#21)
    completes it by excluding leading and trailing optional whitespace from every
    header field value, per RFC 9112 §5 ("A field value does not include leading
    or trailing whitespace"
    ). Two behaviours change for sozu. A legal
    Content-Length: 5 (trailing space) is no longer rejected as an invalid
    field value. And a Transfer-Encoding: chunked\t — which 0.7.0 already framed
    as chunked, since the value is whitespace-trimmed to determine the final
    coding, but then forwarded verbatim — is now forwarded as the canonical
    chunked. Framing on one reading of a value while forwarding another is a
    desync primitive in its own right: with the Content-Length elided, a backend
    that does not itself trim would see neither a coding it recognizes nor a
    length, and would read the chunked body bytes as a pipelined request.

    An whitespace-obfuscated coding is therefore now handled rather than
    refused — it is a legal chunked request, and rejecting it would reject legal
    traffic the same way Content-Length: 5 was being rejected. What sozu
    guarantees is that it never forwards a Transfer-Encoding that differs from
    the framing it applied: it normalizes, or it ...

Read more