1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct Http2Settings {
6 pub header_table_size: Option<u32>,
7 pub enable_push: Option<bool>,
8 pub max_concurrent_streams: Option<u32>,
9 pub initial_window_size: Option<u32>,
10 pub max_frame_size: Option<u32>,
11 pub max_header_list_size: Option<u32>,
12}
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct TlsProfile {
17 pub ciphers: Vec<u16>, pub extensions: Vec<u16>, pub elliptic_curves: Vec<u16>, pub ec_point_formats: Vec<u8>, pub alpn: Vec<String>, pub h2_settings: Http2Settings,
23}
24
25impl TlsProfile {
26 pub fn chrome_131() -> Self {
28 Self {
29 ciphers: vec![
30 0x1301, 0x1302, 0x1303, 0xc02b, 0xc02f, 0xc02c, 0xc030, 0xcca9, 0xcca8, 0xc013, 0xc014, 0x009c, 0x009d, 0x002f, 0x0035, ],
36 extensions: vec![
37 0, 23, 65281, 10, 11, 35, 16, 5, 13, 18, 51, 45, 43, 27, 17513, 21
38 ],
39 elliptic_curves: vec![0x1d, 0x17, 0x18], ec_point_formats: vec![0], alpn: vec!["h2".to_string(), "http/1.1".to_string()],
42 h2_settings: Http2Settings {
43 header_table_size: Some(65536),
44 enable_push: Some(false),
45 max_concurrent_streams: Some(1000),
46 initial_window_size: Some(6291456),
47 max_frame_size: Some(16384),
48 max_header_list_size: Some(262144),
49 },
50 }
51 }
52
53 pub fn firefox_128() -> Self {
55 Self {
56 ciphers: vec![
57 0x1301, 0x1302, 0x1303,
58 0xc02b, 0xc02c, 0xcca9, 0xcca8, 0xc02f, 0xc030, 0xc013, 0xc014, 0x009c, 0x009d, 0x002f, 0x0035
59 ],
60 extensions: vec![
61 0, 23, 65281, 10, 11, 35, 16, 5, 34, 51, 43, 13, 45, 28, 21
62 ],
63 elliptic_curves: vec![0x1d, 0x17, 0x18],
64 ec_point_formats: vec![0],
65 alpn: vec!["h2".to_string(), "http/1.1".to_string()],
66 h2_settings: Http2Settings {
67 header_table_size: Some(65536),
68 enable_push: Some(false),
69 max_concurrent_streams: None,
70 initial_window_size: Some(131072),
71 max_frame_size: Some(16384),
72 max_header_list_size: None,
73 },
74 }
75 }
76}