Skip to content

Commit ff3c6c6

Browse files
committed
Drop deprecated API entry points
1 parent 661577e commit ff3c6c6

File tree

1 file changed

+2
-55
lines changed
  • rustls-platform-verifier/src

1 file changed

+2
-55
lines changed

rustls-platform-verifier/src/lib.rs

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -31,63 +31,10 @@ mod tests;
3131
#[cfg_attr(feature = "ffi-testing", allow(unused_imports))]
3232
pub use tests::ffi::*;
3333

34-
/// Creates and returns a `rustls` configuration that verifies TLS
35-
/// certificates in the best way for the underlying OS platform, using
36-
/// safe defaults for the `rustls` configuration.
37-
///
38-
/// # Example
39-
///
40-
/// This example shows how to use the custom verifier with the `reqwest` crate:
41-
/// ```ignore
42-
/// # use reqwest::ClientBuilder;
43-
/// #[tokio::main]
44-
/// use rustls_platform_verifier::ConfigVerifierExt;
45-
///
46-
/// async fn main() {
47-
/// let client = ClientBuilder::new()
48-
/// .use_preconfigured_tls(ClientConfig::with_platform_verifier())
49-
/// .build()
50-
/// .expect("nothing should fail");
51-
///
52-
/// let _response = client.get("https://example.com").send().await;
53-
/// }
54-
/// ```
55-
///
56-
/// **Important:** You must ensure that your `reqwest` version is using the same Rustls
57-
/// version as this crate or it will panic when downcasting the `&dyn Any` verifier.
58-
///
59-
/// If you require more control over the rustls [`ClientConfig`], you can import the
60-
/// [`BuilderVerifierExt`] trait and call `.with_platform_verifier()` on the [`ConfigBuilder`].
61-
///
62-
/// Refer to the crate level documentation to see what platforms
63-
/// are currently supported.
64-
#[deprecated(since = "0.4.0", note = "use the `ConfigVerifierExt` instead")]
65-
pub fn tls_config() -> ClientConfig {
66-
ClientConfig::with_platform_verifier()
67-
}
68-
69-
/// Attempts to construct a `rustls` configuration that verifies TLS certificates in the best way
70-
/// for the underlying OS platform, using the provided
71-
/// [`CryptoProvider`][rustls::crypto::CryptoProvider].
72-
///
73-
/// See [`tls_config`] for further documentation.
74-
///
75-
/// # Errors
76-
///
77-
/// Propagates any error returned by [`rustls::ConfigBuilder::with_safe_default_protocol_versions`].
78-
#[deprecated(since = "0.4.0", note = "use the `BuilderVerifierExt` instead")]
79-
pub fn tls_config_with_provider(
80-
provider: Arc<rustls::crypto::CryptoProvider>,
81-
) -> Result<ClientConfig, rustls::Error> {
82-
Ok(ClientConfig::builder_with_provider(provider)
83-
.with_safe_default_protocol_versions()?
84-
.with_platform_verifier()
85-
.with_no_client_auth())
86-
}
87-
8834
/// Exposed for debugging certificate issues with standalone tools.
8935
///
90-
/// This is not intended for production use, you should use [tls_config] instead.
36+
/// This is not intended for production use, you should use [`BuilderVerifierExt`] or
37+
/// [`ConfigVerifierExt`] instead.
9138
#[cfg(feature = "dbg")]
9239
pub fn verifier_for_dbg(
9340
root: CertificateDer<'static>,

0 commit comments

Comments
 (0)