Struct rustls::ServerConnection [−][src]
pub struct ServerConnection { /* fields omitted */ }
Expand description
This represents a single TLS server connection.
Send TLS-protected data to the peer using the io::Write
trait implementation.
Read data from the peer using the io::Read
trait implementation.
Implementations
Make a new ServerConnection. config
controls how
we behave in the TLS protocol.
Retrieves the SNI hostname, if any, used to select the certificate and private key.
This returns None
until some time after the client’s SNI extension
value is processed during the handshake. It will never be None
when
the connection is ready to send or process application data, unless the
client does not support SNI.
This is useful for application protocols that need to enforce that the
SNI hostname matches an application layer protocol hostname. For
example, HTTP/1.1 servers commonly expect the Host:
header field of
every request on a connection to match the hostname in the SNI extension
when the client provides the SNI extension.
The SNI hostname is also used to match sessions during session resumption.
Application-controlled portion of the resumption ticket supplied by the client, if any.
Recovered from the prior session’s set_resumption_data
. Integrity is guaranteed by rustls.
Returns Some
iff a valid resumption ticket has been received from the client.
Set the resumption data to embed in future resumption tickets supplied to the client.
Defaults to the empty byte string. Must be less than 2^15 bytes to allow room for other
data. Should be called while is_handshaking
returns true to ensure all transmitted
resumption tickets are affected.
Integrity will be assured by rustls, but the data will be visible to the client. If secrecy from the client is desired, encrypt the data separately.
Explicitly discard early data, notifying the client
Useful if invariants encoded in received_resumption_data()
cannot be respected.
Must be called while is_handshaking
is true.
Trait Implementations
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.
quic
only.Return the TLS-encoded transport parameters for the session’s peer. Read more
quic
only.Compute the keys for encrypting/decrypting 0-RTT packets, if available
quic
only.Emit the TLS description code of a fatal alert, if one has arisen. Read more
quic
only.Compute the keys to use following a 1-RTT key update Read more
fn new_quic(
config: Arc<ServerConfig>,
quic_version: Version,
params: Vec<u8>
) -> Result<ServerConnection, Error>
fn new_quic(
config: Arc<ServerConfig>,
quic_version: Version,
params: Vec<u8>
) -> Result<ServerConnection, Error>
Make a new QUIC ServerConnection. This differs from ServerConnection::new()
in that it takes an extra argument, params
, which contains the
TLS-encoded transport parameters to send. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ServerConnection
impl Send for ServerConnection
impl Sync for ServerConnection
impl Unpin for ServerConnection
impl !UnwindSafe for ServerConnection