When a relay does not recognise a ClientHello it proxies the connection on to the domain it fronts for, so the ServerHello we then verify was written by a real TLS server. Its first application data record carries a certificate chain, which is kilobytes; a relay's is about sixty bytes, for a batch of roughly two hundred in total. The size tells the two apart with no ambiguity, and the reports in hand sat at 1448, 2856 and 4099 bytes against 202 for the connection that worked. Both were reported as "bad Server Hello digest", which points at the relay and hides that the hello never reached it. They are separate reasons now, and the log carries server_hello_foreign_tls for the one that means the relay looked straight past us. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
80 lines
1.8 KiB
C++
80 lines
1.8 KiB
C++
/*
|
|
This file is part of Telegram Desktop,
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
For license and copyright information please follow this link:
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
*/
|
|
#pragma once
|
|
|
|
#include "mtproto/runtime/connection_status_types.h"
|
|
|
|
namespace MTP {
|
|
|
|
enum class ProxyConnectionStatusKind {
|
|
None,
|
|
Resolving,
|
|
Connecting,
|
|
Handshake,
|
|
CheckingTelegram,
|
|
Connected,
|
|
HostNotFound,
|
|
ConnectionRefused,
|
|
Timeout,
|
|
Authentication,
|
|
ProxyProtocol,
|
|
RemoteClosed,
|
|
Network,
|
|
BadResponse,
|
|
Failed,
|
|
MtproxyDnsFailed,
|
|
MtproxyTcpConnectTimeout,
|
|
MtproxyTcpConnectedNoClientHelloWrite,
|
|
MtproxyNoServerHello,
|
|
MtproxyTlsAlert,
|
|
MtproxyServerHelloHmacMismatch,
|
|
MtproxyServerHelloForeignTls,
|
|
MtproxyServerHelloOkNoAppData,
|
|
MtproxyConnectedNoMtprotoData,
|
|
MtproxyAppDataRemoteClosed,
|
|
MtproxyMtpReceiveTimeoutAfterData,
|
|
MtproxyProxyProtocolBadResponse,
|
|
};
|
|
|
|
enum class ProxyConnectionStatusSeverity {
|
|
None,
|
|
Progress,
|
|
Success,
|
|
Warning,
|
|
Error,
|
|
};
|
|
|
|
enum class ProxyConnectionStatusTone {
|
|
None,
|
|
Progress,
|
|
Success,
|
|
Warning,
|
|
Error,
|
|
ErrorDns,
|
|
ErrorTimeout,
|
|
ErrorNetwork,
|
|
ErrorProtocol,
|
|
ErrorAuth,
|
|
ErrorHandshake,
|
|
ErrorData,
|
|
};
|
|
|
|
[[nodiscard]] bool IsMtproxyTerminalFailure(
|
|
ProxyMtproxyTerminalReason reason);
|
|
[[nodiscard]] ProxyConnectionStatusKind ProxyConnectionStatusKindFor(
|
|
const ProxyConnectionStatus &status);
|
|
[[nodiscard]] ProxyConnectionStatusSeverity ProxyConnectionStatusSeverityFor(
|
|
ProxyConnectionStatusKind kind);
|
|
[[nodiscard]] ProxyConnectionStatusSeverity ProxyConnectionStatusSeverityFor(
|
|
const ProxyConnectionStatus &status);
|
|
[[nodiscard]] ProxyConnectionStatusTone ProxyConnectionStatusToneFor(
|
|
ProxyConnectionStatusKind kind);
|
|
[[nodiscard]] ProxyConnectionStatusTone ProxyConnectionStatusToneFor(
|
|
const ProxyConnectionStatus &status);
|
|
|
|
} // namespace MTP
|