Commit Graph

2 Commits

Author SHA1 Message Date
Nicholas Amorim
6b93363b94 feat(core): expose TLS ConnectionState (SNI) for DoQ (#8129)
DoQWriter previously stored only the QUIC stream, so plugins reading
TLS state via dns.ConnectionStater (e.g. for SNI-based routing or
auditing) could not see anything for DoQ connections, even
though the underlying QUIC connection carries a full tls.ConnectionState.

This change adds a *quic.Conn reference to DoQWriter and wires it in serveQUICStream.

It implements dns.ConnectionStater on *DoQWriter, returning the TLS
state from the underlying QUIC connection (mirrors the DoT behavior
that miekg/dns already provides for *tls.Conn)

Forwards ConnectionState through request.ScrubWriter, which wraps
every response writer before the plugin chain runs; the embedded
dns.ResponseWriter interface does not promote ConnectionState (it
belongs to a separate interface), so without this plugins would
still see nil for both DoQ and DoT

Signed-off-by: Nicholas Amorim <nicholas@santos.ee>
2026-05-28 15:45:48 -07:00
Ville Vesilehto
2f9f30934a test(request): improve coverage across package (#7307)
Add tests for previously untested functions:
- edns0.go: test supportedOptions function
- request.go: test address methods, protocol handling, and EDNS0
  options
- writer.go: test ScrubWriter implementation

Improves overall package test coverage from 39.5% to 77.8%.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2025-05-19 14:23:58 -04:00