pub fn default_provider() -> CryptoProvider
Expand description
Returns an OpenSSL-based CryptoProvider using default available cipher suites (ALL_CIPHER_SUITES) and key exchange groups ([ALL_KX_GROUPS]).
Sample usage:
use rustls::{ClientConfig, RootCertStore};
use rustls_openssl::default_provider;
use std::sync::Arc;
use webpki_roots;
let mut root_store = RootCertStore {
roots: webpki_roots::TLS_SERVER_ROOTS.iter().cloned().collect(),
};
let mut config =
ClientConfig::builder_with_provider(Arc::new(default_provider()))
.with_safe_default_protocol_versions()
.unwrap()
.with_root_certificates(root_store)
.with_no_client_auth();