add ability to create a client with own tls connector (#809)
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| use std::any::Any; | ||||
| use std::convert::TryInto; | ||||
| use std::fmt; | ||||
| use std::future::Future; | ||||
| @@ -450,6 +451,15 @@ impl ClientBuilder { | ||||
|         self.with_inner(move |inner| inner.use_rustls_tls()) | ||||
|     } | ||||
|  | ||||
|     /// Use a preconfigured TLS backend. | ||||
|     /// | ||||
|     /// If the passed `Any` argument is not a TLS backend that reqwest | ||||
|     /// understands, the `ClientBuilder` will error when calling `build`. | ||||
|     #[cfg(feature = "__tls")] | ||||
|     pub fn use_preconfigured_tls(self, tls: impl Any) -> ClientBuilder { | ||||
|         self.with_inner(move |inner| inner.use_preconfigured_tls(tls)) | ||||
|     } | ||||
|  | ||||
|     // private | ||||
|  | ||||
|     fn with_inner<F>(mut self, func: F) -> ClientBuilder | ||||
|   | ||||
		Reference in New Issue
	
	Block a user