rustls_openssl

Function default_provider

Source
pub fn default_provider() -> CryptoProvider
Expand description

default_provider returns a CryptoProvider using default and cipher suites. For cipher suites seeDEFAULT_CIPHER_SUITES.

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();