pingly 0.2.0

TLS and HTTP/1/2/3 fingerprint analysis server and Rust library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
use std::{
    net::SocketAddr,
    sync::{Arc, OnceLock},
    time::Duration,
};

use axum::{
    body::Body,
    http::{header::USER_AGENT, HeaderValue, Method, Request},
};
use pingly::{
    h1::{Http1Head, RequestHead},
    h2::AkamaiFingerprint,
    h3::Http3Fingerprint,
    tls::{ClientHelloHandshakeBuffer, ClientHelloParseError, TlsVersion},
};
use serde::{Serialize, Serializer};
use tokio_rustls::rustls::ProtocolVersion;

use super::inspector::{ClientHello, ClientHelloBuffer, Http1RequestCapture, Http2Frame};
use crate::server::quic::inspect::{HeadersCapture, SettingsCapture};
#[cfg(target_os = "linux")]
use crate::tcp::{CapturedPacket, TcpAnalysis};

/// TLS handshake tracking information, which includes the client hello payload.
#[derive(Serialize)]
pub struct TlsTrackInfo {
    /// The unhashed JA3 string built from the ClientHello.
    ja3: Box<str>,

    /// The lowercase MD5 digest of the JA3 string.
    ja3_hash: Box<str>,

    /// The JA4 fingerprint derived from the ClientHello.
    #[serde(rename = "ja4")]
    ja4_fingerprint: Box<str>,

    /// The unhashed JA4_r representation used to inspect its input values.
    #[serde(rename = "ja4_r")]
    ja4_raw: Box<str>,

    /// Parsed ClientHello fields flattened into the TLS response object.
    #[serde(flatten)]
    client_hello: ClientHello,
}

/// HTTP/1.x request header tracking information.
pub struct Http1TrackInfo {
    /// Request parsed from its raw capture during response analysis.
    request: RequestHead,
}

/// HTTP/2 tracking information, including Akamai fingerprint and sent frames.
#[derive(Serialize)]
pub struct Http2TrackInfo {
    /// The unhashed Akamai fingerprint derived from the captured client frames.
    akamai_fingerprint: Box<str>,

    /// The lowercase MD5 digest of the Akamai fingerprint.
    akamai_fingerprint_hash: Box<str>,

    /// Client HTTP/2 frames retained in their original wire order.
    #[serde(serialize_with = "serialize_sent_frames")]
    sent_frames: Http2Frame,
}

/// HTTP/3 tracking information from the client's control and request streams.
#[derive(Serialize)]
pub struct Http3TrackInfo {
    /// Fingerprint derived from the client SETTINGS frame.
    #[serde(flatten)]
    fingerprint: Http3Fingerprint,

    /// Client SETTINGS frame captured from the HTTP/3 control stream.
    #[serde(serialize_with = "serialize_settings_capture")]
    settings: SettingsCapture,

    /// First HEADERS frame captured from this request stream.
    #[serde(serialize_with = "serialize_headers_capture")]
    headers: HeadersCapture,
}

#[derive(Clone)]
enum ClientHelloCapture {
    /// ClientHello retained with its TLS record framing on a TCP connection.
    Records(ClientHelloBuffer),

    /// ClientHello retained directly from QUIC CRYPTO handshake bytes.
    Handshake(Arc<OnceLock<ClientHelloHandshakeBuffer>>),
}

impl ClientHelloCapture {
    fn parse(self) -> Option<Result<ClientHello, ClientHelloParseError>> {
        match self {
            Self::Records(buffer) => Some(buffer.parse()),
            Self::Handshake(capture) => capture.get().map(ClientHelloHandshakeBuffer::parse),
        }
    }
}

#[derive(Clone)]
struct Http3RequestCapture {
    /// SETTINGS shared by all requests on one HTTP/3 connection.
    settings: SettingsCapture,

    /// HEADERS belonging to the current HTTP/3 request stream.
    headers: HeadersCapture,
}

/// Collects TLS, HTTP/1, HTTP/2, and HTTP/3 handshake info for tracking.
#[derive(Clone, Default)]
pub struct ConnectionTrack {
    /// The TLS protocol version that was negotiated for this connection, if any.
    tls_version_negotiated: Option<ProtocolVersion>,

    /// Wall-clock time spent completing the TLS handshake after TCP accept.
    tls_handshake_duration: Option<Duration>,

    /// Raw TLS records retained until the ClientHello can be analyzed.
    client_hello: Option<ClientHelloCapture>,

    /// Raw HTTP/1 request head shared with the stream inspector for delayed parsing.
    http1_capture: Option<Http1RequestCapture>,

    /// HTTP/2 client frames retained in their received order.
    http2_frames: Option<Http2Frame>,

    /// HTTP/3 control-stream SETTINGS and request-stream HEADERS captures.
    http3_capture: Option<Http3RequestCapture>,
}

/// Tracking details collected for a single connection.
///
/// Includes the TLS, HTTP/1, HTTP/2, and HTTP/3 analysis selected for the response.
#[derive(Serialize)]
pub struct TrackInfo {
    /// Project information included in every analysis response.
    donate: &'static str,

    /// Remote peer address associated with the request.
    address: SocketAddr,

    /// HTTP version used by the request.
    http_version: String,

    /// HTTP request method.
    #[serde(serialize_with = "serialize_method")]
    method: Method,

    /// User-Agent request header, when present.
    #[serde(serialize_with = "serialize_user_agent")]
    user_agent: Option<HeaderValue>,

    /// TLS analysis requested for this response, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    tls: Option<TlsTrackInfo>,

    /// HTTP/1 header analysis requested for this response, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    http1: Option<Http1TrackInfo>,

    /// HTTP/2 frame analysis requested for this response, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    http2: Option<Http2TrackInfo>,

    /// HTTP/3 and QUIC analysis requested for this response, when available.
    #[serde(skip_serializing_if = "Option::is_none")]
    http3: Option<Http3TrackInfo>,

    /// Captured TCP packets and passive fingerprint for Linux `/api/all` responses.
    #[cfg(target_os = "linux")]
    #[serde(skip_serializing_if = "Option::is_none")]
    tcp: Option<TcpAnalysis>,
}

/// Track enum to specify which tracking information to collect.
#[repr(u8)]
#[derive(Clone, Copy)]
pub enum Track {
    All,
    Tls,
    HTTP1,
    HTTP2,
    HTTP3,
}

impl Track {
    const fn includes_tls(self) -> bool {
        matches!(self, Track::All | Track::Tls)
    }

    const fn includes_http1(self) -> bool {
        matches!(self, Track::All | Track::HTTP1)
    }

    const fn includes_http2(self) -> bool {
        matches!(self, Track::All | Track::HTTP2)
    }

    const fn includes_http3(self) -> bool {
        matches!(self, Track::All | Track::HTTP3)
    }
}

struct ProtocolTrackInfo {
    tls: Option<TlsTrackInfo>,
    http1: Option<Http1TrackInfo>,
    http2: Option<Http2TrackInfo>,
    http3: Option<Http3TrackInfo>,
}

// ==== impl TlsTrackInfo ====

impl TlsTrackInfo {
    /// Create a new [`TlsTrackInfo`] instance.
    pub fn new(client_hello: ClientHello) -> TlsTrackInfo {
        let ja3 = client_hello.ja3();
        let ja4 = client_hello.ja4();

        TlsTrackInfo {
            ja3: ja3.raw,
            ja3_hash: ja3.hash,
            ja4_fingerprint: ja4.fingerprint,
            ja4_raw: ja4.raw,
            client_hello,
        }
    }

    /// Set TLS version negotiated during the handshake.
    pub fn set_tls_version_negotiated(&mut self, version: Option<ProtocolVersion>) {
        self.client_hello
            .set_tls_version_negotiated(version.map(u16::from).map(TlsVersion::from));
    }
}

// ==== impl Http1TrackInfo ====

impl Http1TrackInfo {
    /// Create a new [`Http1TrackInfo`] instance.
    pub fn new(request: RequestHead) -> Http1TrackInfo {
        Http1TrackInfo { request }
    }
}

impl Serialize for Http1TrackInfo {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        self.request.headers.serialize(serializer)
    }
}

// ==== impl Http2TrackInfo ====

impl Http2TrackInfo {
    /// Create a new [`Http2TrackInfo`] instance.
    pub fn new(sent_frames: Http2Frame) -> Option<Http2TrackInfo> {
        let akamai = AkamaiFingerprint::from_frames(sent_frames.iter().map(|(_, frame)| frame))?;

        Some(Self {
            akamai_fingerprint: akamai.fingerprint,
            akamai_fingerprint_hash: akamai.hash,
            sent_frames,
        })
    }
}

fn serialize_sent_frames<S>(sent_frames: &Http2Frame, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    let vec = sent_frames
        .iter()
        .map(|(_, value)| value)
        .collect::<Vec<_>>();
    vec.serialize(serializer)
}

// ==== impl Http3TrackInfo ====

impl Http3TrackInfo {
    /// Builds HTTP/3 analysis only after both client frames have been captured.
    fn new(capture: Http3RequestCapture) -> Option<Self> {
        let settings = capture.settings.get()?;
        let headers = capture.headers.get()?;
        let fingerprint = Http3Fingerprint::from_frames(settings, headers);

        Some(Self {
            fingerprint,
            settings: capture.settings,
            headers: capture.headers,
        })
    }
}

fn serialize_settings_capture<S>(
    capture: &SettingsCapture,
    serializer: S,
) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    match capture.get() {
        Some(frame) => frame.serialize(serializer),
        None => Err(serde::ser::Error::custom(
            "HTTP/3 SETTINGS capture is not complete",
        )),
    }
}

fn serialize_headers_capture<S>(capture: &HeadersCapture, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    match capture.get() {
        Some(frame) => frame.serialize(serializer),
        None => Err(serde::ser::Error::custom(
            "HTTP/3 HEADERS capture is not complete",
        )),
    }
}

// ==== impl ConnectionTrack ====

impl ConnectionTrack {
    /// Set TLS version negotiated during the handshake.
    #[inline]
    pub fn set_tls_version_negotiated(&mut self, version: Option<ProtocolVersion>) {
        self.tls_version_negotiated = version;
    }

    /// Records the server-observed duration of the TLS handshake.
    #[inline]
    pub fn set_tls_handshake_duration(&mut self, duration: Duration) {
        self.tls_handshake_duration = Some(duration);
    }

    /// Returns the server-observed TLS handshake duration.
    #[inline]
    #[cfg(target_os = "linux")]
    pub fn tls_handshake_duration(&self) -> Option<Duration> {
        self.tls_handshake_duration
    }

    /// Sets a ClientHello captured with TLS record framing.
    #[inline]
    pub fn set_client_hello(&mut self, client_hello: Option<ClientHelloBuffer>) {
        self.client_hello = client_hello.map(ClientHelloCapture::Records);
    }

    /// Sets a ClientHello captured from QUIC CRYPTO handshake bytes.
    #[inline]
    pub fn set_client_hello_handshake(
        &mut self,
        client_hello: Arc<OnceLock<ClientHelloHandshakeBuffer>>,
    ) {
        self.client_hello = Some(ClientHelloCapture::Handshake(client_hello));
    }

    /// Sets the raw HTTP/1 request head shared with delayed analysis.
    #[inline]
    pub fn set_http1_request_capture(&mut self, capture: Http1RequestCapture) {
        self.http1_capture = Some(capture);
    }

    /// Sets captured HTTP/2 frames.
    #[inline]
    pub fn set_http2_frames(&mut self, frames: Http2Frame) {
        self.http2_frames = Some(frames);
    }

    /// Sets HTTP/3 control-stream SETTINGS and request-stream HEADERS captures.
    #[inline]
    pub(in crate::server) fn set_http3_capture(
        &mut self,
        settings: SettingsCapture,
        headers: HeadersCapture,
    ) {
        self.http3_capture = Some(Http3RequestCapture { settings, headers });
    }
}

fn protocol_track_info(track: Track, connection_track: ConnectionTrack) -> ProtocolTrackInfo {
    let ConnectionTrack {
        tls_version_negotiated,
        tls_handshake_duration: _,
        client_hello,
        http1_capture,
        http2_frames,
        http3_capture,
    } = connection_track;

    let mut client_hello = if track.includes_tls() {
        client_hello.and_then(|capture| match capture.parse() {
            Some(Ok(client_hello)) => Some(client_hello),
            Some(Err(error)) => {
                tracing::debug!(?error, "failed to parse captured ClientHello");
                None
            }
            None => {
                tracing::debug!("ClientHello capture was not complete before analysis");
                None
            }
        })
    } else {
        None
    };

    let http3 = if track.includes_http3() {
        http3_capture.and_then(|capture| {
            let info = Http3TrackInfo::new(capture);
            if info.is_none() {
                tracing::debug!("HTTP/3 SETTINGS or HEADERS capture was not complete");
            }
            info
        })
    } else {
        None
    };

    let mut tls = track
        .includes_tls()
        .then(|| client_hello.take())
        .flatten()
        .map(TlsTrackInfo::new);
    if let Some(tls) = tls.as_mut() {
        tls.set_tls_version_negotiated(tls_version_negotiated);
    }

    let http1 = if track.includes_http1() {
        http1_capture.and_then(|capture| {
            let buffer = capture.get()?;
            match buffer.parse() {
                Ok(Http1Head::Request(request)) => Some(Http1TrackInfo::new(request)),
                Ok(Http1Head::Response(_)) => {
                    tracing::debug!("request capture unexpectedly contained an HTTP/1 response");
                    None
                }
                Err(error) => {
                    tracing::debug!(?error, "failed to parse captured HTTP/1 request head");
                    None
                }
            }
        })
    } else {
        None
    };
    let http2 = if track.includes_http2() {
        http2_frames.and_then(Http2TrackInfo::new)
    } else {
        None
    };

    ProtocolTrackInfo {
        tls,
        http1,
        http2,
        http3,
    }
}

// ==== impl TrackInfo ====

impl TrackInfo {
    const DONATE_MESSAGE: &'static str = "Please consider supporting Pingly to keep this API running. Visit https://github.com/0x676e67/pingly";

    /// Create a new [`TrackInfo`] instance.
    #[inline]
    pub fn new(
        track: Track,
        addr: SocketAddr,
        req: Request<Body>,
        connection_track: ConnectionTrack,
    ) -> TrackInfo {
        #[cfg(target_os = "linux")]
        return Self::new_with_tcp(track, addr, req, connection_track, Vec::new());

        #[cfg(not(target_os = "linux"))]
        {
            let ProtocolTrackInfo {
                tls,
                http1,
                http2,
                http3,
            } = protocol_track_info(track, connection_track);

            TrackInfo {
                donate: Self::DONATE_MESSAGE,
                address: addr,
                http_version: format!("{:?}", req.version()),
                method: req.method().clone(),
                user_agent: req.headers().get(USER_AGENT).cloned(),
                tls,
                http1,
                http2,
                http3,
            }
        }
    }

    /// Create a new [`TrackInfo`] instance with TCP data.
    #[inline]
    #[cfg(target_os = "linux")]
    pub fn new_with_tcp(
        track: Track,
        addr: SocketAddr,
        req: Request<Body>,
        connection_track: ConnectionTrack,
        tcp_packets: Vec<CapturedPacket>,
    ) -> TrackInfo {
        let ProtocolTrackInfo {
            tls,
            http1,
            http2,
            http3,
        } = protocol_track_info(track, connection_track);

        TrackInfo {
            donate: Self::DONATE_MESSAGE,
            address: addr,
            http_version: format!("{:?}", req.version()),
            method: req.method().clone(),
            user_agent: req.headers().get(USER_AGENT).cloned(),
            tls,
            http1,
            http2,
            http3,
            #[cfg(target_os = "linux")]
            tcp: matches!(track, Track::All)
                .then(|| TcpAnalysis::from_packets(tcp_packets))
                .filter(|analysis| !analysis.is_empty()),
        }
    }
}

fn serialize_user_agent<S>(value: &Option<HeaderValue>, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    match value {
        Some(value) => value
            .to_str()
            .map_err(serde::ser::Error::custom)
            .and_then(|s| serializer.serialize_str(s)),
        None => serializer.serialize_none(),
    }
}

fn serialize_method<S>(method: &Method, serializer: S) -> Result<S::Ok, S::Error>
where
    S: Serializer,
{
    serializer.serialize_str(method.as_str())
}

#[cfg(test)]
mod tests {
    use std::sync::{Arc, OnceLock};

    use pingly::{
        h1::Http1HeadBuffer,
        h3::{FrameType, HeaderField, HeadersFrame, Setting, SettingsFrame},
        tls::ClientHelloHandshakeBuffer,
    };
    use serde_json::json;

    use super::{protocol_track_info, ConnectionTrack, Track};
    use crate::server::quic::inspect::SettingsCapture;

    fn quic_client_hello() -> ClientHelloHandshakeBuffer {
        let transport_parameters = [0x00, 0x39, 0x00, 0x03, 0x04, 0x01, 0x20];
        let mut body = vec![0x03, 0x03];
        body.extend_from_slice(&[0; 32]);
        body.extend_from_slice(&[0, 0, 2, 0x13, 0x01, 1, 0]);
        let extensions_len = u16::try_from(transport_parameters.len()).unwrap();
        body.extend_from_slice(&extensions_len.to_be_bytes());
        body.extend_from_slice(&transport_parameters);

        let length = u32::try_from(body.len()).unwrap().to_be_bytes();
        let mut handshake = vec![1, length[1], length[2], length[3]];
        handshake.extend_from_slice(&body);
        ClientHelloHandshakeBuffer::from_bytes(handshake)
    }

    #[test]
    fn http1_capture_is_parsed_when_analysis_is_built() {
        let wire = b"GET / HTTP/1.1\r\nuSeR-aGeNt: curl\r\n\r\n";
        let mut buffer = Http1HeadBuffer::request();
        assert_eq!(buffer.extend(wire), wire.len());

        let capture = Arc::new(OnceLock::new());
        capture.set(buffer).unwrap();

        let mut connection = ConnectionTrack::default();
        connection.set_http1_request_capture(capture);
        let http1 = protocol_track_info(Track::HTTP1, connection).http1.unwrap();

        assert_eq!(
            serde_json::to_value(http1).unwrap(),
            json!([{"name": "uSeR-aGeNt", "value": "curl"}])
        );
    }

    #[test]
    fn http3_capture_is_fingerprinted_when_analysis_is_built() {
        let settings = SettingsCapture::new();
        settings.set(SettingsFrame {
            frame_type: FrameType::Settings,
            length: 5,
            settings: vec![Setting::try_from_wire(1, 65_536).unwrap()],
        });

        let headers = Arc::new(OnceLock::new());
        headers
            .set(HeadersFrame {
                frame_type: FrameType::Headers,
                length: 16,
                headers: vec![
                    HeaderField {
                        name: b":method".as_slice().into(),
                        value: b"GET".as_slice().into(),
                    },
                    HeaderField {
                        name: b":path".as_slice().into(),
                        value: b"/api/http3".as_slice().into(),
                    },
                ],
            })
            .unwrap();

        let client_hello = Arc::new(OnceLock::new());
        client_hello.set(quic_client_hello()).unwrap();

        let mut connection = ConnectionTrack::default();
        connection.set_client_hello_handshake(client_hello);
        connection.set_http3_capture(settings, headers);
        let analysis = protocol_track_info(Track::All, connection);
        let tls = serde_json::to_value(analysis.tls.unwrap()).unwrap();
        let http3 = analysis.http3.unwrap();
        let value = serde_json::to_value(http3).unwrap();

        assert_eq!(value["h3_text"], "1:65536|m,p");
        assert_eq!(value["h3_text_hash"], "7b9ae05c41a8dab63ad54ead553ed227");
        assert_eq!(
            value["settings"]["settings"][0]["name"],
            "QpackMaxTableCapacity"
        );
        assert_eq!(value["headers"]["headers"][1]["name"], ":path");
        assert_eq!(
            tls["extensions"][0]["quic_transport_parameters"]["data"],
            json!([{"id": 4, "name": "initial_max_data", "value": 32}])
        );
        assert!(tls["ja4"].as_str().is_some_and(|ja4| ja4.starts_with('q')));
        assert!(tls["ja4_r"]
            .as_str()
            .is_some_and(|ja4_r| ja4_r.starts_with('q')));
        assert!(value.get("fingerprint").is_none());
        assert!(value.get("normalized_fingerprint").is_none());
        assert!(value.get("normalized_h3_text").is_none());
        assert!(value.get("normalized_h3_text_hash").is_none());
        assert!(value.get("quic_transport_parameters").is_none());
    }

    #[test]
    fn track_only_includes_requested_protocol_analysis() {
        assert!(Track::All.includes_tls());
        assert!(Track::All.includes_http1());
        assert!(Track::All.includes_http2());
        assert!(Track::All.includes_http3());
        assert!(Track::Tls.includes_tls());
        assert!(Track::HTTP1.includes_http1());
        assert!(Track::HTTP2.includes_http2());
        assert!(Track::HTTP3.includes_http3());
        assert!(!Track::HTTP1.includes_tls());
        assert!(!Track::HTTP2.includes_tls());
        assert!(!Track::HTTP3.includes_tls());
        assert!(!Track::Tls.includes_http1());
        assert!(!Track::Tls.includes_http2());
        assert!(!Track::Tls.includes_http3());
    }
}