Skip to main content

validate_profile_static

Function validate_profile_static 

Source
pub fn validate_profile_static(
    profile: &TlsProfile,
    expected_ja3: &str,
    expected_ja4: &str,
    expected_alpn: &[(&str, &str)],
) -> TlsValidationReport
Expand description

Validate a TlsProfile against reference hashes without making a network connection.

The expected_ja3 and expected_ja4 parameters are compared against the hashes computed from the profile’s cipher/extension/group fields.

§Example

use stygian_browser::tls::{CHROME_131, TlsProfile};
use stygian_browser::tls_validation::{validate_profile_static, CHROME_131_JA3};

let report = validate_profile_static(
    &CHROME_131,
    CHROME_131_JA3,
    "",
    &[("h2", "http/1.1")],
);
// JA3 match depends on whether the profile matches the reference capture
// (may differ across Chrome versions — see issues for details)
let _ = report.is_ok();