Module rustls_ffi::server

source ·

Structs

The TLS Client Hello information provided to a ClientHelloCallback function. sni_name is the SNI servername provided by the client. If the client did not provide an SNI, the length of this rustls_string will be 0. The signature_schemes carries the values supplied by the client or, should the client not use this TLS extension, the default schemes in the rustls library. See: https://docs.rs/rustls/0.20.0/rustls/internal/msgs/enums/enum.SignatureScheme.html. alpn carries the list of ALPN protocol names that the client proposed to the server. Again, the length of this list will be 0 if none were supplied.
A server config that is done being constructed and is now read-only. Under the hood, this object corresponds to an Arc<ServerConfig>. https://docs.rs/rustls/0.20.0/rustls/struct.ServerConfig.html
A server config being constructed. A builder can be modified by, e.g. rustls_server_config_builder_load_native_roots. Once you’re done configuring settings, call rustls_server_config_builder_build to turn it into a *const rustls_server_config. This object is not safe for concurrent mutation. https://docs.rs/rustls/0.20.0/rustls/struct.ConfigBuilder.html

Functions

Select a rustls_certified_key from the list that matches the cryptographic parameters of a TLS client hello. Note that this does not do any SNI matching. The input certificates should already have been filtered to ones matching the SNI from the client hello.
Copy the SNI hostname to buf which can hold up to count bytes, and the length of that hostname in out_n. The string is stored in UTF-8 with no terminating NUL byte. Returns RUSTLS_RESULT_INSUFFICIENT_SIZE if the SNI hostname is longer than count. Returns Ok with *out_n == 0 if there is no SNI hostname available on this connection because it hasn’t been processed yet, or because the client did not send SNI. https://docs.rs/rustls/0.20.0/rustls/server/struct.ServerConnection.html#method.sni_hostname

Type Definitions

Prototype of a callback that can be installed by the application at the rustls_server_config. This callback will be invoked by a rustls_connection once the TLS client hello message has been received. userdata will be set based on rustls_connection_set_userdata. hello gives the value of the available client announcements, as interpreted by rustls. See the definition of rustls_client_hello for details.
Any context information the callback will receive when invoked.