Following up on #488 (comment) — opening this so we can agree on shape before a PR.
Today Doctor.checkNetworkAddresses (internal/cli/doctor.go:286) marks a DC healthy as soon as ntw.DialContext returns a net.Conn. Any process listening on :443 passes, which is the shallowness you flagged.
What I'd like to do: after the TCP connect, wrap the conn with the existing obfuscated2 framing from mtglib/internal/obfuscation, send req_pq_multi with a random nonce, and expect a resPQ echoing it back. That's unauthenticated (no auth_key, no state introduced), one round-trip, and a generic listener can't fake it. Two TL messages, so I'd hand-roll the (de)serialization rather than pull in gotd/td or similar — but open to the dependency if you'd prefer.
Output would gain an rpc <rtt> next to the connect line, and failures would distinguish "TCP failed" from "TCP ok, RPC failed". Same treatment for both native and chained-proxy paths (the chained-proxy case is exactly where shallow checks mislead). checkFrontingDomain stays as-is. One PR.
Does this match what you had in mind, or did you want something heavier (full DH + authenticated ping)? Happy to put up the PR if the approach looks right.
Following up on #488 (comment) — opening this so we can agree on shape before a PR.
Today
Doctor.checkNetworkAddresses(internal/cli/doctor.go:286) marks a DC healthy as soon asntw.DialContextreturns anet.Conn. Any process listening on:443passes, which is the shallowness you flagged.What I'd like to do: after the TCP connect, wrap the conn with the existing obfuscated2 framing from
mtglib/internal/obfuscation, sendreq_pq_multiwith a random nonce, and expect aresPQechoing it back. That's unauthenticated (noauth_key, no state introduced), one round-trip, and a generic listener can't fake it. Two TL messages, so I'd hand-roll the (de)serialization rather than pull ingotd/tdor similar — but open to the dependency if you'd prefer.Output would gain an
rpc <rtt>next to the connect line, and failures would distinguish "TCP failed" from "TCP ok, RPC failed". Same treatment for both native and chained-proxy paths (the chained-proxy case is exactly where shallow checks mislead).checkFrontingDomainstays as-is. One PR.Does this match what you had in mind, or did you want something heavier (full DH + authenticated
ping)? Happy to put up the PR if the approach looks right.