Skip to content

Fix TLS fingerprint detection in MTProto proxy ClientHello#1949

Open
reyohoho wants to merge 1 commit into
DrKLO:masterfrom
reyohoho:fix/mtproto-tls-clienthello-fingerprint
Open

Fix TLS fingerprint detection in MTProto proxy ClientHello#1949
reyohoho wants to merge 1 commit into
DrKLO:masterfrom
reyohoho:fix/mtproto-tls-clienthello-fingerprint

Conversation

@reyohoho
Copy link
Copy Markdown

@reyohoho reyohoho commented Apr 3, 2026

Summary

Fixes MTProto Fake-TLS proxy detection by Russian DPI systems (TSPU/VAS Expert/RDP-Ru).
Two changes in TMessagesProj/jni/tgnet/ConnectionSocket.cpp (the TlsHello structure):

  • Op::string("\xfe\x02", 2)Op::string("\xfe\x0d", 2)
    Extension type 0xfe02 is not a valid TLS extension and was listed in the TSPU fingerprint database as TELEGRAM_TLS. Replaced with 0xfe0d (ECH draft-era identifier) to match a real ClientHello structure.
  • Op::random(20)Op::random(32)
    Random key data length increased from 20 to 32 bytes to match the standard X25519 key share size in TLS 1.3.

Motivation

Since April 1, 2026, TSPU (Russian state DPI, VAS Expert / RDP-Ru vendors) added TELEGRAM_TLS signature based on the old JA3/JA4 fingerprint of the MTProto Fake-TLS ClientHello. This caused mass blocking of MTProto proxy connections for users in Russia.
This is the Android equivalent of the fix accepted into Telegram Desktop:
telegramdesktop/tdesktop@407bf19 (inspired by telegramdesktop/tdesktop#30513)
John Preston confirmed in that PR:

"For now I was told to change only \xfe\x02 and R(20)R(32), so I add them for the next release."

Testing

  • Tested on Android with MTProto Fake-TLS proxies on networks with active DPI filtering (Russian mobile operators)
  • MTProto proxy connections restored and stable after the change
  • Community testing in t.me/telemtrs confirmed the fix works

Replace extension type 0xfe02 with 0xfe0d (ECH draft identifier)
and increase random data length from 20 to 32 bytes in TlsHello.

These two values were causing TSPU (Russian DPI) to identify
MTProto Fake-TLS proxy traffic via JA3/JA4 fingerprinting as
TELEGRAM_TLS and block it since April 1, 2026.

Inspired by telegramdesktop/tdesktop#30513 and commit 407bf19.
Tested and confirmed working with MTProto Fake-TLS proxies
on networks with active DPI filtering.

Made-with: Cursor
@dginorg
Copy link
Copy Markdown

dginorg commented Apr 3, 2026

Originally posted by @dginorg in #617

12.6.4 Android beta contains proposed client hello fix telegramdesktop/tdesktop#30513

confirmed by community members via ech+random pcap diff 12.6.x analysis

dont forget to use EE secret (not DD)

@pfeux
Copy link
Copy Markdown

pfeux commented Apr 4, 2026

Hello @Arseny271, please upgrade to latest version. Thank you 🙏

@shadowlmd
Copy link
Copy Markdown

Why is this critical fix still in beta? It was confirmed working in first hours.

@b0r1ngx
Copy link
Copy Markdown

b0r1ngx commented Apr 6, 2026

Pavel and team, stop write about AI. Help us!

Actual both for Android & iOS!

@Remu-rin
Copy link
Copy Markdown

Remu-rin commented Apr 6, 2026

Fixed in 009e973
Released to Google Play

@b0r1ngx
Copy link
Copy Markdown

b0r1ngx commented Apr 6, 2026

Awesome, thanks, mtproxy start working again.

Waiting it for iOS ❤️ hope to get it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants