mirror of https://github.com/ctz/rustls
client: move danger mod lower in builder.rs
The other items in this module are `pub`, the `pub(crate)` danger module should be at the bottom.
This commit is contained in:
parent
ffcc718e23
commit
7f8fa55cef
|
@ -68,40 +68,6 @@ impl ConfigBuilder<ClientConfig, WantsVerifier> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Container for unsafe APIs
|
||||
pub(super) mod danger {
|
||||
use alloc::sync::Arc;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use crate::client::WantsClientCert;
|
||||
use crate::{verify, ClientConfig, ConfigBuilder, WantsVerifier};
|
||||
|
||||
/// Accessor for dangerous configuration options.
|
||||
#[derive(Debug)]
|
||||
pub struct DangerousClientConfigBuilder {
|
||||
/// The underlying ClientConfigBuilder
|
||||
pub cfg: ConfigBuilder<ClientConfig, WantsVerifier>,
|
||||
}
|
||||
|
||||
impl DangerousClientConfigBuilder {
|
||||
/// Set a custom certificate verifier.
|
||||
pub fn with_custom_certificate_verifier(
|
||||
self,
|
||||
verifier: Arc<dyn verify::ServerCertVerifier>,
|
||||
) -> ConfigBuilder<ClientConfig, WantsClientCert> {
|
||||
ConfigBuilder {
|
||||
state: WantsClientCert {
|
||||
provider: self.cfg.state.provider,
|
||||
versions: self.cfg.state.versions,
|
||||
verifier,
|
||||
time_provider: self.cfg.state.time_provider,
|
||||
},
|
||||
side: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A config builder state where the caller needs to supply whether and how to provide a client
|
||||
/// certificate.
|
||||
///
|
||||
|
@ -167,3 +133,37 @@ impl ConfigBuilder<ClientConfig, WantsClientCert> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Container for unsafe APIs
|
||||
pub(super) mod danger {
|
||||
use alloc::sync::Arc;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use crate::client::WantsClientCert;
|
||||
use crate::{verify, ClientConfig, ConfigBuilder, WantsVerifier};
|
||||
|
||||
/// Accessor for dangerous configuration options.
|
||||
#[derive(Debug)]
|
||||
pub struct DangerousClientConfigBuilder {
|
||||
/// The underlying ClientConfigBuilder
|
||||
pub cfg: ConfigBuilder<ClientConfig, WantsVerifier>,
|
||||
}
|
||||
|
||||
impl DangerousClientConfigBuilder {
|
||||
/// Set a custom certificate verifier.
|
||||
pub fn with_custom_certificate_verifier(
|
||||
self,
|
||||
verifier: Arc<dyn verify::ServerCertVerifier>,
|
||||
) -> ConfigBuilder<ClientConfig, WantsClientCert> {
|
||||
ConfigBuilder {
|
||||
state: WantsClientCert {
|
||||
provider: self.cfg.state.provider,
|
||||
versions: self.cfg.state.versions,
|
||||
verifier,
|
||||
time_provider: self.cfg.state.time_provider,
|
||||
},
|
||||
side: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue