Skip to content

doctor: deepen DC verification beyond TCP connect #494

@dolonet

Description

@dolonet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions