pub struct UpstreamExtras {
pub dot_sni: Option<String>,
pub dot_server: Option<String>,
pub dot_port: Option<u16>,
pub doh_url: Option<String>,
pub doq_server: Option<String>,
pub doq_port: Option<u16>,
}Expand description
Optional per-transport extras the caller may supply alongside
UpstreamTransport. Populated by super::DnsProxyConfig::upstream_extras
in production; tests construct via Default::default() and then set only
the fields they care about.
All fields are optional so the do53-udp hot path doesn’t require
any extras to function — unused fields incur zero cost.
Fields§
§dot_sni: Option<String>SNI hostname presented during the DoT TLS handshake. When None,
rustls is given the resolver’s IP literal — most public DoT resolvers
(1.1.1.1 / 8.8.8.8) ship a cert that covers both the hostname and
the IP, but operators with a private resolver will need to set this
to the cert’s CN/SAN.
dot_server: Option<String>Operator-supplied DoT server host. When set (typically populated from
the CELLOS_DNS_UPSTREAM_DOT_SERVER env var), the supervisor pre-resolves
this to a SocketAddr and substitutes the proxy’s upstream_addr,
so the DoT roundtrip targets the operator’s choice rather than the
spec’s do53 resolver. None falls back to the spec resolver’s IP.
Plain string here (not pre-resolved) so the config struct stays transport-agnostic and the resolution step lives in the composition root where DNS bootstrap is allowed.
dot_port: Option<u16>Operator-supplied DoT port (RFC 7858 default = 853). Paired with
Self::dot_server; when None the supervisor defaults to 853.
doh_url: Option<String>DNS-DOH-2 — operator-supplied DoH endpoint URL. When None the
DoH forward path defaults to [DEFAULT_DOH_URL]. Sourced from
CELLOS_DNS_UPSTREAM_DOH_URL in production. Must be a full
https://… URL including the /dns-query path; reqwest validates
the scheme on first call and surfaces a typed
[UpstreamError::Io(InvalidInput)] if it’s malformed.
doq_server: Option<String>DNS-DOQ-2 — operator-supplied DoQ server (IP literal or hostname).
None → default 1.1.1.1. Sourced from
CELLOS_DNS_UPSTREAM_DOQ_SERVER. Hostnames are passed through to
tokio::net::lookup_host (which uses the OS resolver, NOT the
supervisor’s bootstrap path) — operators should prefer IP literals
for the same reason DoT does (see [parse_dot_target]).
doq_port: Option<u16>DNS-DOQ-2 — operator-supplied DoQ port. None → default 853
(RFC 9250). Sourced from CELLOS_DNS_UPSTREAM_DOQ_PORT.
Implementations§
Source§impl UpstreamExtras
impl UpstreamExtras
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Read the DoT-specific operator overrides from the process environment.
Recognised env vars:
CELLOS_DNS_UPSTREAM_DOT_SERVER— host (IP literal or hostname) for the DoT upstream. Default unset (caller falls back to the spec resolver’s IP, or to1.1.1.1if the caller has no spec to fall back on).CELLOS_DNS_UPSTREAM_DOT_PORT— TCP port. Default unset (caller falls back to853per RFC 7858).CELLOS_DNS_UPSTREAM_DOT_SNI— explicit SNI hostname. Default unset (rustls receives the resolver’s IP literal as ServerName).
Unparseable port values are silently ignored (the field stays None)
rather than failing — operators get the default behaviour instead of
a refused cell. Strict parsing is the supervisor’s job at the composition
site if it wants to gate startup on a typo.
Trait Implementations§
Source§impl Clone for UpstreamExtras
impl Clone for UpstreamExtras
Source§fn clone(&self) -> UpstreamExtras
fn clone(&self) -> UpstreamExtras
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UpstreamExtras
impl Debug for UpstreamExtras
Source§impl Default for UpstreamExtras
impl Default for UpstreamExtras
Source§fn default() -> UpstreamExtras
fn default() -> UpstreamExtras
Auto Trait Implementations§
impl Freeze for UpstreamExtras
impl RefUnwindSafe for UpstreamExtras
impl Send for UpstreamExtras
impl Sync for UpstreamExtras
impl Unpin for UpstreamExtras
impl UnsafeUnpin for UpstreamExtras
impl UnwindSafe for UpstreamExtras
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more