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
// Copyright (c) 2026 Erik Lening (hollowpointer) and Contributors
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// https://mozilla.org/MPL/2.0/.
//! # TLS certificate analyzer
//!
//! The first non-regex [`Analyzer`]: it turns a captured certificate chain into
//! [`Evidence`], proving out the extension point on a source that is structured
//! binary rather than a text banner.
//!
//! What a certificate reliably tells us about *what a port runs* is deliberately
//! modest, and this analyzer claims only that much:
//!
//! * **The port speaks TLS** — reported as service `ssl` at [`Probable`]
//! confidence. That is a real, useful label (far better than a raw handshake
//! blob) but shallow: it does not name the application protocol inside the
//! tunnel. A later phase re-probes *through* the tunnel and will override this
//! with a stronger, more specific verdict.
//! * **A self-signed cert's organization names its operator/vendor.** When the
//! subject equals the issuer (self-signed — typical of appliances and internal
//! services) the subject `O=` reliably names who stood the service up, so it is
//! surfaced as `vendor`. For CA-signed certs `O=` names the CA or the cert
//! owner, neither of which is the product vendor, so we do not guess.
//!
//! Host attribution (subject CN / SAN hostnames) is intentionally *not* produced
//! here: it describes the host, not the service, and has no home on [`Evidence`]
//! yet. It is a separate follow-up.
//!
//! [`Analyzer`]: super::analyzer::Analyzer
//! [`Probable`]: super::model::Confidence::Probable
use async_trait;
use parse_x509_certificate;
use ;
use ;
use ;
/// Identifies TLS-bearing ports from the certificate captured during the
/// handshake. See the module docs for what it does and does not claim.
;