Create custom CryptoProvider with specified cipher suites and key exchange groups This helper function consolidates the duplicated CryptoProvider creation logic for both server and client configurations.
(
cipher_suites: Option<Vec<rustls::SupportedCipherSuite>>,
kx_groups: Option<Vec<&'static dyn rustls::crypto::SupportedKxGroup>>,
)
| 660 | /// This helper function consolidates the duplicated CryptoProvider creation logic |
| 661 | /// for both server and client configurations. |
| 662 | fn create_custom_crypto_provider( |
| 663 | cipher_suites: Option<Vec<rustls::SupportedCipherSuite>>, |
| 664 | kx_groups: Option<Vec<&'static dyn rustls::crypto::SupportedKxGroup>>, |
| 665 | ) -> Arc<rustls::crypto::CryptoProvider> { |
| 666 | use rustls::crypto::aws_lc_rs::{ALL_CIPHER_SUITES, ALL_KX_GROUPS}; |
| 667 | let default_provider = rustls::crypto::aws_lc_rs::default_provider(); |
| 668 | |
| 669 | Arc::new(rustls::crypto::CryptoProvider { |
| 670 | cipher_suites: cipher_suites.unwrap_or_else(|| ALL_CIPHER_SUITES.to_vec()), |
| 671 | kx_groups: kx_groups.unwrap_or_else(|| ALL_KX_GROUPS.to_vec()), |
| 672 | signature_verification_algorithms: default_provider.signature_verification_algorithms, |
| 673 | secure_random: default_provider.secure_random, |
| 674 | key_provider: default_provider.key_provider, |
| 675 | }) |
| 676 | } |
| 677 | |
| 678 | /// Create a server TLS configuration |
| 679 | /// |
no test coverage detected