Struct rustls::ClientConnection[][src]

pub struct ClientConnection { /* fields omitted */ }
Expand description

This represents a single TLS client connection.

Implementations

Make a new ClientConnection. config controls how we behave in the TLS protocol, name is the name of the server we want to talk to.

Returns an io::Write implementer you can write bytes to to send TLS1.3 early data (a.k.a. “0-RTT data”) to the server.

This returns None in many circumstances when the capability to send early data is not available, including but not limited to:

  • The server hasn’t been talked to previously.
  • The server does not support resumption.
  • The server does not support early data.
  • The resumption data for the server has expired.

The server specifies a maximum amount of early data. You can learn this limit through the returned object, and writes through it will process only this many bytes.

The server can choose not to accept any sent early data – in this case the data is lost but the connection continues. You can tell this happened using is_early_data_accepted.

Returns True if the server signalled it will process early data.

If you sent early data and this returns false at the end of the handshake then the server will not process the data. This is not an error, but you may wish to resend the data.

Trait Implementations

Make a new QUIC ClientConnection. This differs from ClientConnection::new() in that it takes an extra argument, params, which contains the TLS-encoded transport parameters to send. Read more

Writes TLS messages to wr.

Read TLS content from rd. This method does internal buffering, so rd can supply TLS messages in arbitrary- sized chunks (like a socket or pipe might). Read more

Processes any new packets read by a previous call to Connection::read_tls. Read more

Returns true if the caller should call Connection::read_tls as soon as possible. Read more

Returns true if the caller should call Connection::write_tls as soon as possible. Read more

Returns true if the connection is currently performing the TLS handshake. Read more

Sets a limit on the internal buffers used to buffer unsent plaintext (prior to completing the TLS handshake) and unsent TLS records. This limit acts only on application data written through Connection::writer. Read more

Queues a close_notify warning alert to be sent in the next Connection::write_tls call. This informs the peer that the connection is being closed. Read more

Retrieves the certificate chain used by the peer to authenticate. Read more

Retrieves the protocol agreed with the peer via ALPN. Read more

Retrieves the protocol version agreed with the peer. Read more

Derives key material from the agreed connection secrets. Read more

Retrieves the ciphersuite agreed with the peer. Read more

Returns an object that allows writing plaintext.

Returns an object that allows reading plaintext.

This function uses io to complete any outstanding IO for this connection. Read more

Formats the value using the given formatter. Read more

This is supported on crate feature quic only.

Return the TLS-encoded transport parameters for the session’s peer. Read more

This is supported on crate feature quic only.

Compute the keys for encrypting/decrypting 0-RTT packets, if available

This is supported on crate feature quic only.

Consume unencrypted TLS handshake data. Read more

This is supported on crate feature quic only.

Emit unencrypted TLS handshake data. Read more

This is supported on crate feature quic only.

Emit the TLS description code of a fatal alert, if one has arisen. Read more

This is supported on crate feature quic only.

Compute the keys to use following a 1-RTT key update Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.