@@ -31,63 +31,10 @@ mod tests;
31
31
#[ cfg_attr( feature = "ffi-testing" , allow( unused_imports) ) ]
32
32
pub use tests:: ffi:: * ;
33
33
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
-
88
34
/// Exposed for debugging certificate issues with standalone tools.
89
35
///
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.
91
38
#[ cfg( feature = "dbg" ) ]
92
39
pub fn verifier_for_dbg (
93
40
root : CertificateDer < ' static > ,
0 commit comments