dot upstreams: per-upstream tls_name for sni and cert verification by dns name

This commit is contained in:
2026-08-01 14:38:45 +02:00
parent 70bff22d75
commit 3baf5d6581
13 changed files with 405 additions and 17 deletions
+10
View File
@@ -1011,3 +1011,13 @@ review rounds; findings went 9 → 3 → 0):
`OutOfMemory` is a local resource, not a peer fault.
- `transport.zig`: `Endpoint.parse` rejects userinfo/query/fragment delimiters
(`@`, `?`, `#`) in the authority, and `?`/`#` in a DoH path.
- `dot_client.zig` (follow-up, tls_name commit): `DotClient.init` takes a
`tls_name`; it is the SNI and certificate-verification name, while the dial
target stays `endpoint.host`. Empty keeps the endpoint host, which is the
behavior described above. The same follow-up fixed a send bug this file
had from the start, invisible until a DoT handshake first succeeded:
`tls.Client.flush` only encrypts into the socket writer's buffer and never
flushes it, so the query never left the process and the peer eventually
closed the connection (`ReceiveFailed`/`EndOfStream`). `TlsStream.flush` now
does both flushes and `exchange` calls it; a hermetic loopback test in
`tls_client_integration_test.zig` covers it.