pub struct ClientHello<'a> { /* private fields */ }展开描述
A struct 表示 the received Client Hello
实现§
Source§impl<'a> ClientHello<'a>
impl<'a> ClientHello<'a>
Sourcepub fn server_name(&self) -> Option<&str>
pub fn server_name(&self) -> Option<&str>
Get 服务器名 indicator.
Returns None if the client did not supply 一个 SNI.
Sourcepub fn signature_schemes(&self) -> &[SignatureScheme]
pub fn signature_schemes(&self) -> &[SignatureScheme]
获取兼容的签名方案
Returns 标准-specified default if the client omitted this extension.
Sourcepub fn alpn(&self) -> Option<impl Iterator<Item = &'a [u8]>>
pub fn alpn(&self) -> Option<impl Iterator<Item = &'a [u8]>>
获取 ALPN protocol identifiers submitted by the client.
Returns None if the client did not include an ALPN extension.
Application Layer Protocol Negotiation (ALPN) 是 TLS extension that lets 一个 client submit 一个 set of identifiers that each 一个 represent an application-layer protocol. 此 server will then pick its preferred protocol 从 the set submitted by the client. Each 标识符 is represented as 一个 byte array, although common values are often ASCII-encoded. ,请参见 official RFC-7301 specifications at https://datatracker.ietf.org/doc/html/rfc7301 用于 more information on ALPN.
For example, 一个 HTTP client might specify “http/1.1” 并/或 “h2”。 Other well-known values are listed in the at IANA registry at https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids。
此 server can specify supported ALPN protocols by setting ServerConfig::alpn_protocols。
During the handshake, the server will select the first protocol configured that the client supports.
Sourcepub fn cipher_suites(&self) -> &[CipherSuite]
pub fn cipher_suites(&self) -> &[CipherSuite]
获取密码套件。
Sourcepub fn server_cert_types(&self) -> Option<&'a [CertificateType]>
pub fn server_cert_types(&self) -> Option<&'a [CertificateType]>
获取 server certificate types offered in the ClientHello.
Returns None if the client did not include 一个 certificate type extension.
Sourcepub fn client_cert_types(&self) -> Option<&'a [CertificateType]>
pub fn client_cert_types(&self) -> Option<&'a [CertificateType]>
获取 client certificate types offered in the ClientHello.
Returns None if the client did not include 一个 certificate type extension.
获取 certificate_authorities extension sent by the client.
Returns None if the client did not send this extension.
Sourcepub fn named_groups(&self) -> Option<&'a [NamedGroup]>
pub fn named_groups(&self) -> Option<&'a [NamedGroup]>
获取 named_groups extension sent by the client.
This means different things in different versions of TLS:
Originally it was introduced as the “elliptic_curves” extension 用于 TLS1.2.
It described the elliptic curves supported by 一个 client 用于 all purposes: key
exchange, signature verification (用于 server authentication), 并 signing (用于
client auth)。 Later RFC7919 extended this 到 include FFDHE “named groups”,
but FFDHE groups in this context only relate 到 key exchange.
In TLS 1.3 it was renamed 到 “named_groups” 并 now describes all types
of key exchange mechanisms, 并 does not relate at all 到 elliptic curves
用 用于 签名。