Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions doc/bin/relay/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The fields are documented on `moq_auth::Request` and `moq_auth::Grant`
([Rust](/lib/rs/moq-auth), [TypeScript](/lib/js/auth)).

`server_name` is the SNI that selected the relay's certificate. It is absent
over plaintext, on the `tls://` TCP listener, and for an IP-literal dial, and
over plaintext and for an IP-literal dial, and
never filled from a `Host` header or a WebTransport authority. The client still picks it among the names
the relay serves, so a hostname-scoped server binds the tenant to the
credential, not to `server_name` alone.
Expand Down Expand Up @@ -304,8 +304,8 @@ the relay reports it in the request and enforces the grant it gets back.
`moq auth serve` grants a certificate only what `--mtls-publish` and
`--mtls-subscribe` name, nothing by default. Public rules ignore certificates,
so `--auth-public` with a client CA refuses to start. Only the QUIC listener
verifies client certificates, so a relay without `listen.bind` refuses
`listen.tls.root` too.
and a `tls://` TCP listener (`listen.tcp.tls`) verify client certificates, so a
relay with neither refuses `listen.tls.root` too.

Cluster peers are admitted the same way, so a mesh runs
`moq auth serve --mtls-publish '**' --mtls-subscribe '**' --mtls-link peer` (or a
Expand Down Expand Up @@ -438,5 +438,6 @@ identity. The Unix socket is created mode `0666`, so gate it with a restrictive
parent directory or an allowlist.

`listen.tcp.tls = true` serves the TCP listener over TLS instead, for `tls://`
dials such as [cluster links](/bin/relay/cluster#tls-links). It asks for no
client certificate, so a peer on it presents a token, not mTLS.
dials such as [cluster links](/bin/relay/cluster#tls-links). It asks for a
client certificate as the QUIC listener does, under the same `listen.tls.root`,
so a peer on it presents a certificate or a token.
7 changes: 4 additions & 3 deletions doc/bin/relay/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ topology check; whatever generates the peer list applies the layout's rules.
A link inside a region is rarely congested, so it can skip QUIC: a `tls://`
peer URL dials qmux over TLS on TCP, verified with the same `connect.tls`
settings as any other dial. The accepting relay serves it from its TCP
listener with TLS on. That listener asks for no client certificate, so a peer
on it authenticates with a token (`cluster.token`, `token`, or `?jwt=`), not
mTLS.
listener with TLS on. That listener applies the same client-certificate policy
as the QUIC listener, so a peer on it authenticates with its `connect.tls`
certificate against `listen.tls.root`, or with a token (`cluster.token`,
`token`, or `?jwt=`).

```toml
# core.toml
Expand Down
4 changes: 2 additions & 2 deletions doc/bin/relay/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ secret = "/etc/moq/reset.key" # File holding 64 hex chars. Omit for a ran
cert = "cert.pem" # Certificate chain and key. Reloaded on change.
key = "key.pem"
generate = ["localhost"] # Or: a self-signed cert for development.
root = ["peer-ca.pem"] # Optional: CAs for client certs (mTLS), reported to the auth server. Needs QUIC.
root = ["peer-ca.pem"] # Optional: CAs for client certs (mTLS), reported to the auth server. Needs QUIC or tcp.tls.

[listen.tcp] # Plaintext qmux over TCP for trusted local workers.
bind = "127.0.0.1:4444"
# tls = true # Or: qmux over TLS (tls://) with the listen certificate, no client certs.
# tls = true # Or: qmux over TLS (tls://) with the listen certificate and client-cert policy.

[listen.unix] # Plaintext qmux over a Unix socket, gated by peer credentials.
bind = "/run/moq/internal.sock"
Expand Down
1 change: 0 additions & 1 deletion quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ lite-07; bitrate enforcement is not part of this release.
- [#3199](/quest/m2/3199-moq-uring-remove-sq-indirection-and-per-enter-ring-fd.md) - moq-uring: remove SQ indirection and per-enter ring fd lookup, if a profile shows the win
- [#3200](/quest/m2/3200-moq-uring-batch-completion-wakeups-with-min-timeout.md) - moq-uring: batch completion wakeups with MIN_TIMEOUT
- [Browser media report](/quest/m2/rs2ts-browser-report.md) - compare Rust-backed and handwritten @moq/net through full media workloads, supplementing the pre-adoption comparisons
- [mTLS on tls://](/quest/m2/tls-listener-mtls.md) - a `tls://` listener can identify a cluster peer by its client certificate
- [Link quality](/quest/m2/link-quality.md) - a radio link's cost follows its measured quality without flapping routes
- [io_uring handle lifecycle](/quest/m2/uring-lifecycle.md) - handles fail once their worker is gone, close on last drop like tokio, and surface a close behind unread data
- [io_uring socket teardown](/quest/m2/uring-socket-teardown.md) - socket churn never exhausts buffer-group ids, and a failed receive cancel surfaces
Expand Down
14 changes: 8 additions & 6 deletions quest/m2/one-port/tcp-demux.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ ALPN to the router. A connection with no ALPN keeps the decrypted-byte
sniff, since RTMPS clients negotiate none (`moq-rtmp` documents an empty
ALPN list): `0x03` is RTMP, anything else is HTTP.

Decided 2026-10-08: under one acceptor, the client-certificate request from
[mTLS on tls://](/quest/m2/tls-listener-mtls.md) is optional (never required)
and sits on the moq-ALPN TLS config only, so browsers and RTMPS clients on
the same port are never asked for one. Whichever lands second keeps `tls://`
client-certificate verification and the `MtlsUnsupported` lift working.
Decided 2026-10-08: under one acceptor, the client-certificate request the
`tls://` listener makes (since
[moq-dev/moq#7358](https://github.com/moq-dev/moq/pull/7358)) sits on the moq-ALPN TLS
config only, so browsers and RTMPS clients on the same port are never asked
for one. ✅ Decided 2026-10-30 (maintainer): it is optional under CA roots and
required under pinned `tls.peers`, as on QUIC, so pinned mode still means
the listener knows who connected. Keep `tls://` client-certificate
verification and the `MtlsUnsupported` lift working.

Keep the accepted `TcpStream`'s handle reachable after it is boxed: the
relay already captures socket stats at accept for qmux (`SocketStats` in
Expand All @@ -55,5 +58,4 @@ right arm.
## Related

- [UDP demux](/quest/m2/p2p/udp-demux.md) - the UDP half
- [mTLS on tls://](/quest/m2/tls-listener-mtls.md) - client-certificate verification on the `tls://` arm this acceptor carries
- [WebSocket bitrate caps](/quest/m2/rate-websocket.md) - sizes the kernel buffers of the socket this acceptor boxes
1 change: 0 additions & 1 deletion quest/m2/perf/stream/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ binding that starts a qmux session. The Impact bullet says how to migrate.
## Related

- [qmux byte counters](/quest/m2/wire-stats/qmux.md) - refreshes `Wire` counters on qmux's read/write path
- [tls:// peers authenticate by certificate](/quest/m2/tls-listener-mtls.md) - changes `qmux::tls::Server::accept`
- [qmux leases receive memory](/quest/m2/qmux-receive-lease.md) - changes qmux's `RecvStream` and window defaults
46 changes: 0 additions & 46 deletions quest/m2/tls-listener-mtls.md

This file was deleted.

11 changes: 9 additions & 2 deletions rs/moq-relay/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Rolling a cluster across a release also follows the [upgrade guide](https://moq.

## Unreleased

### `tls://` links verify client certificates ([#7358](https://github.com/moq-dev/moq/pull/7358))

The `listen.tcp.tls` listener applies `listen.tls.root` and pinned `tls.peers` as the QUIC listener does, so a stream-only relay with that listener no longer refuses them.
A peer dialing `tls://` with a `connect.tls` certificate now presents it, and a certificate presented beside a JWT is refused as it is on QUIC: give such a peer `cluster.token` or a certificate, not both.
With pinned `tls.peers`, a `tls://` peer must present a pinned certificate; a token alone is refused.
The auth request's `server_name` reports the SNI on `tls://` too.

### Paths with an empty segment are refused ([#6648](https://github.com/moq-dev/moq/pull/6648))

A session dialed at a URL path with a trailing or doubled `/`, such as `/room/` or `/room//cam`, is refused as a bad request instead of collapsed; dial `/room`. An auth grant whose `root`, `mounts`, `tier`, or `label` has one is refused as forbidden, and `stats.prefix`, `stats.node`, and `--cluster-tier` with one refuse to start.
Expand Down Expand Up @@ -145,8 +152,8 @@ Set `load_balancer`, or `lb_id` alone (nonce 8), or `lb_id` with `lb_nonce`.

### Settings no listener reads stop startup (#5006)

A stream-only relay (TCP or Unix, no `--listen`) refuses the QUIC-only `--listen-preferred-v4` / `-v6`, `--listen-quic-lb-id`, and pinned `tls.peers`.
It also refuses `--listen-tls-cert`, `-key`, or `-generate` unless `--listen-tcp-tls` serves it, and `listen.tls.root`, since only QUIC verifies a client CA.
A stream-only relay (TCP or Unix, no `--listen`) refuses the QUIC-only `--listen-preferred-v4` / `-v6` and `--listen-quic-lb-id`.
It also refuses `--listen-tls-cert`, `-key`, or `-generate` unless `--listen-tcp-tls` serves it, and `listen.tls.root` or pinned `tls.peers` unless `--listen-tcp-tls` verifies them.
`--listen-unix-allow-*` needs `--listen-unix-bind`, and `web.https.cert`, `key`, and `root` need `web.https.listen`.
Each used to be ignored: drop it, or add the listener it configures.

Expand Down
8 changes: 4 additions & 4 deletions rs/moq-relay/tests/integration/public_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ async fn a_client_ca_needs_an_auth_server() {
}
}

/// A stream-only relay has no QUIC listener to verify a client CA, and its stream
/// listeners never ask for a client certificate, so the CA is refused rather than
/// silently ignored.
/// A relay with only a plaintext TCP listener has no QUIC or `tls://` listener to
/// verify a client CA, and plaintext TCP never asks for a client certificate, so
/// the CA is refused rather than silently ignored.
#[tokio::test]
async fn a_client_ca_needs_a_quic_listener() {
async fn a_client_ca_needs_a_verifying_listener() {
let mut config = moq_relay::Config::default();
config.auth.url = Some("http://127.0.0.1:4440/".parse().expect("parse url"));
config.listen.tcp.bind = Some("127.0.0.1:0".parse().expect("parse addr"));
Expand Down
12 changes: 9 additions & 3 deletions rs/moq-tokio/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ How to update your code for each breaking change, newest first.

## Unreleased

### `tls://` listeners verify client certificates ([#7358](https://github.com/moq-dev/moq/pull/7358))

A `listen.tcp.tls` listener serves the listen policy's client-certificate verifier, so `--listen-tls-root` and pinned `tls.peers` apply to it as they do to QUIC, and a stream-only server with that listener accepts them instead of returning `Error::MtlsUnsupported`.
Its `Request::peer_identity`, `server_name`, and `authority` report the client chain and SNI, which were always `None`.
Under pinned peers, a `tls://` client must present a pinned certificate, as on QUIC.

### `Connection::allocator` ([#6751](https://github.com/moq-dev/moq/pull/6751))

`Connection::bandwidth()` is `Connection::allocator()`, mirroring `moq_net::Session::allocator()`.
Expand Down Expand Up @@ -138,13 +144,13 @@ Set `load_balancer`, or `lb_id` alone (nonce 8), or `lb_id` with `lb_nonce`.

### Settings no listener reads stop startup (#5006)

A stream-only listener (TCP or Unix, no QUIC bind) refuses the QUIC-only `preferred_v4` / `preferred_v6`, `lb_id`, pinned `tls.peers`, and a TLS cert, key, or `generate` unless `tcp.tls` serves it.
A stream-only listener (TCP or Unix, no QUIC bind) refuses the QUIC-only `preferred_v4` / `preferred_v6` and `lb_id`, and a TLS cert, key, or `generate` unless `tcp.tls` serves it.
`unix.allow_*` needs `unix.bind`.
Each used to be ignored: drop it, or add the listener it configures.

### A client CA needs a QUIC listener
### A client CA needs a QUIC or `tls://` listener

A stream-only listener with `listen.tls.root` returns `Error::MtlsUnsupported` instead of silently verifying nothing.
A stream-only listener with `listen.tls.root` or pinned `tls.peers` returns `Error::MtlsUnsupported` unless `tcp.tls` verifies them, instead of silently verifying nothing.

### `Transport` names WebTransport

Expand Down
4 changes: 2 additions & 2 deletions rs/moq-tokio/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ pub enum Error {
#[error("Iroh support is not enabled")]
IrohDisabled,

/// A client CA or pinned peers were configured on a stream-only server, which has no QUIC listener to verify them.
/// A client CA or pinned peers were configured on a server with no QUIC or `tls://` listener to verify them.
#[error(
"mTLS (--listen-tls-root or tls.peers) needs a QUIC listener (--listen); the TCP and Unix listeners never ask for a client certificate"
"mTLS (--listen-tls-root or tls.peers) needs a QUIC listener (--listen) or a TLS TCP listener (--listen-tcp-tls); the plaintext TCP and Unix listeners never ask for a client certificate"
)]
MtlsUnsupported,

Expand Down
Loading