Generate a synthetic session ID from server name and timestamp NOTE: This is NOT the actual TLS session ID, just a unique identifier
(server_name: &str, time: &SystemTime)
| 435 | // Generate a synthetic session ID from server name and timestamp |
| 436 | // NOTE: This is NOT the actual TLS session ID, just a unique identifier |
| 437 | fn generate_session_id_from_metadata(server_name: &str, time: &SystemTime) -> Vec<u8> { |
| 438 | let mut hasher = Sha256::new(); |
| 439 | hasher.update(server_name.as_bytes()); |
| 440 | hasher.update( |
| 441 | time.duration_since(SystemTime::UNIX_EPOCH) |
| 442 | .unwrap() |
| 443 | .as_secs() |
| 444 | .to_le_bytes(), |
| 445 | ); |
| 446 | hasher.finalize()[..16].to_vec() |
| 447 | } |
| 448 | |
| 449 | // Custom ClientSessionStore that tracks session metadata for Python access |
| 450 | // NOTE: This wraps ClientSessionMemoryCache and records metadata when sessions are stored |
no test coverage detected