diff --git a/td/mtproto/TcpTransport.cpp b/td/mtproto/TcpTransport.cpp index d9c75b65..00963e73 100644 --- a/td/mtproto/TcpTransport.cpp +++ b/td/mtproto/TcpTransport.cpp @@ -147,12 +147,15 @@ void ObfuscatedTransport::init(ChainBufferReader *input, ChainBufferWriter *outp try_cnt++; CHECK(try_cnt < 10); Random::secure_bytes(header_slice.ubegin(), header.size()); + if (secret_.emulate_tls()) { + break; + } if (as(header.data()) == 0xef) { continue; } uint32 first_int = as(header.data()); if (first_int == 0x44414548 || first_int == 0x54534f50 || first_int == 0x20544547 || first_int == 0x4954504f || - first_int == 0xdddddddd || first_int == 0xeeeeeeee) { + first_int == 0xdddddddd || first_int == 0xeeeeeeee || first_int == 0x02010316) { continue; } uint32 second_int = as(header.data() + sizeof(uint32));