Skip to content

Commit f47e366

Browse files
jonnyzzzclaude
andcommitted
fix(mtproto): bump FakeTLS tolerance to 30s — 3 s default rejects real clients
Production deploy surfaced every Telegram-client attempt being refused with: "cannot read client hello" error="timestamp \"2026-04-22 21:50:20 +0000 UTC\" is too old 3.038756662s" mtg's DefaultTolerateTimeSkewness is 3 seconds. Normal network latency plus a sub-second clock skew between the client and the proxy exceeds that. Telegram's own reference configuration example recommends 5 s; mtg docs show deployments commonly running at 30 s+. Set 30 s here so real-world clients are actually accepted. This is the root cause of "proxy not available" reported by the admin after the v0.12.0 rollout; the dispatcher + secret + DC connectivity all check out. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6871dd6 commit f47e366

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internal/mtproto/runtime.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ func (r *Runtime) Start(ctx context.Context) error {
142142
Concurrency: uint(dispatcherCfg.MaxConnections),
143143
DomainFrontingPort: uint(port),
144144
DomainFrontingIP: host,
145+
// mtg's default tolerance is ~3 s, which rejects clients even
146+
// with normal network latency + a sub-second clock skew. A real
147+
// deployment saw every Telegram client attempt rejected with
148+
// "timestamp … is too old 3.04 s". Bump to 30 s — matches mtg's
149+
// upstream recommendation for real-world deployments.
150+
TolerateTimeSkewness: 30 * time.Second,
145151
})
146152
if err != nil {
147153
return fmt.Errorf("mtproto runtime: new proxy for %s: %w", b.FQDN, err)

0 commit comments

Comments
 (0)