跳到主要内容

ClientHello

结构体 ClientHello 

Source
pub struct ClientHello<'a> { /* private fields */ }
展开描述

A struct 表示 the received Client Hello

实现§

Source§

impl<'a> ClientHello<'a>

Source

pub fn server_name(&self) -> Option<&str>

Get 服务器名 indicator.

Returns None if the client did not supply 一个 SNI.

Source

pub fn signature_schemes(&self) -> &[SignatureScheme]

获取兼容的签名方案

Returns 标准-specified default if the client omitted this extension.

Source

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.

Source

pub fn cipher_suites(&self) -> &[CipherSuite]

获取密码套件。

Source

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.

Source

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.

Source

pub fn certificate_authorities(&self) -> Option<&'a [DistinguishedName]>

获取 certificate_authorities extension sent by the client.

Returns None if the client did not send this extension.

Source

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 用 用于 签名。

Trait 实现§

Source§

impl<'a> Debug for ClientHello<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

使用给定的格式化器格式化此值。 更多信息

自动 Trait 实现§

§

impl<'a> Freeze for ClientHello<'a>

§

impl<'a> RefUnwindSafe for ClientHello<'a>

§

impl<'a> Send for ClientHello<'a>

§

impl<'a> Sync for ClientHello<'a>

§

impl<'a> Unpin for ClientHello<'a>

§

impl<'a> UnsafeUnpin for ClientHello<'a>

§

impl<'a> UnwindSafe for ClientHello<'a>

Blanket 实现§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows 从 an owned value. 更多信息
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows 从 an owned value. 更多信息
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回传入的参数。

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::从(self)

That is, this conversion is whatever the implementation of From<T> 用于 U 的实现方式。

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

转换出错时返回的类型。
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

转换出错时返回的类型。
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。