Skip to content

Commit

Permalink
lib: expose Verifier as part of public API.
Browse files Browse the repository at this point in the history
Additionally add a brief comment to the `tls_config()` doc pointing out
that constructing a `Verifier` by hand allows customizing the rustls
`ClientConfig` for advanced use cases.
  • Loading branch information
cpu committed Aug 31, 2023
1 parent 1770e0c commit 9e8ce31
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustls::ClientConfig;
use std::sync::Arc;

mod verification;
use verification::Verifier;
pub use verification::Verifier;

// Build the Android module when generating docs so that
// the Android-specific functions are included.
Expand All @@ -28,7 +28,8 @@ mod tests;
pub use tests::ffi::*;

/// Creates and returns a `rustls` configuration that verifies TLS
/// certificates in the best way for the underlying OS platform.
/// certificates in the best way for the underlying OS platform, using
/// safe defaults for the `rustls` configuration.
///
/// # Example
///
Expand All @@ -46,6 +47,10 @@ pub use tests::ffi::*;
/// }
/// ```
///
/// If you require more control over the rustls `ClientConfig`, you can
/// instantiate a [Verifier] with [Verifier::default] and then use it
/// with [rustls::ConfigBuilder::with_custom_certificate_verifier].
///
/// Refer to the crate level documentation to see what platforms
/// are currently supported.
pub fn tls_config() -> ClientConfig {
Expand Down

0 comments on commit 9e8ce31

Please sign in to comment.