Skip to main content

CipherSuiteSelector

Trait CipherSuiteSelector 

Source
pub trait CipherSuiteSelector:
    Debug
    + Send
    + Sync {
    // Required methods
    fn select_tls12_cipher_suite(
        &self,
        client: &mut dyn Iterator<Item = &'static Tls12CipherSuite>,
        server: &[&'static Tls12CipherSuite],
    ) -> Option<&'static Tls12CipherSuite>;
    fn select_tls13_cipher_suite(
        &self,
        server: &mut dyn Iterator<Item = &'static Tls13CipherSuite>,
        server: &[&'static Tls13CipherSuite],
    ) -> Option<&'static Tls13CipherSuite>;
}
Expand description

A filter that chooses the cipher suite to use for a TLS session.

Required Methods§

Source

fn select_tls12_cipher_suite( &self, client: &mut dyn Iterator<Item = &'static Tls12CipherSuite>, server: &[&'static Tls12CipherSuite], ) -> Option<&'static Tls12CipherSuite>

Choose a cipher suite, given the client’s and server’s options, in preference order.

The client list is generated in order from the CipherSuite values received in the ClientHello, filtered to only contain suites that the server supports. The server list comes from the ServerConfig’s CryptoProvider.

Yields the chosen cipher suite supported by both sides, or None to indicate that no mutually supported cipher suite could be agreed on.

Source

fn select_tls13_cipher_suite( &self, server: &mut dyn Iterator<Item = &'static Tls13CipherSuite>, server: &[&'static Tls13CipherSuite], ) -> Option<&'static Tls13CipherSuite>

Choose a cipher suite, given the client’s and server’s options, in preference order.

The client list is generated in order from the CipherSuite values received in the ClientHello, filtered to only contain suites that the server supports. The server list comes from the ServerConfig’s CryptoProvider.

Yields the chosen cipher suite supported by both sides, or None to indicate that no mutually supported cipher suite could be agreed on.

Implementors§