ALPN in TLS Fetcher

Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
Alexey
2026-04-23 22:22:05 +03:00
parent 67357310f7
commit 493f5c9680
2 changed files with 388 additions and 53 deletions

View File

@@ -880,7 +880,6 @@ pub fn detect_client_hello_tls_version(handshake: &[u8]) -> Option<ClientHelloTl
return None;
}
let mut saw_supported_versions = false;
while pos + 4 <= ext_end {
let etype = u16::from_be_bytes([handshake[pos], handshake[pos + 1]]);
let elen = u16::from_be_bytes([handshake[pos + 2], handshake[pos + 3]]) as usize;
@@ -890,7 +889,6 @@ pub fn detect_client_hello_tls_version(handshake: &[u8]) -> Option<ClientHelloTl
}
if etype == extension_type::SUPPORTED_VERSIONS {
saw_supported_versions = true;
if elen < 1 {
return None;
}
@@ -922,10 +920,6 @@ pub fn detect_client_hello_tls_version(handshake: &[u8]) -> Option<ClientHelloTl
pos += elen;
}
if saw_supported_versions {
return None;
}
if legacy_version >= 0x0303 {
Some(ClientHelloTlsVersion::Tls12)
} else {