Skip to main content

crypto_provider

Function crypto_provider 

Source
pub fn crypto_provider() -> CryptoProvider
Expand description

Returns an aws-lc-rs CryptoProvider with all CCM suites appended.

The default suites keep priority: a rustls server built from this provider still prefers AES-GCM / ChaCha20-Poly1305 and falls back to CCM only for peers that offer nothing stronger. To prefer CCM (e.g. a profile that mandates it, like IEEE 2030.5), insert the suites you want at the front instead:

let mut provider = rustls::crypto::aws_lc_rs::default_provider();
provider
    .cipher_suites
    .insert(0, *rustls_ccm::TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8);