Rename AgentBuilder set_tls_config -> tls_config
For consistency. We don't use set_xxx on the builder.
This commit is contained in:
@@ -364,12 +364,12 @@ impl AgentBuilder {
|
||||
/// ```
|
||||
/// let tls_config = std::sync::Arc::new(rustls::ClientConfig::new());
|
||||
/// let agent = ureq::builder()
|
||||
/// .set_tls_config(tls_config.clone())
|
||||
/// .tls_config(tls_config.clone())
|
||||
/// .build();
|
||||
/// let req = agent.post("https://cool.server");
|
||||
/// ```
|
||||
#[cfg(feature = "tls")]
|
||||
pub fn set_tls_config(mut self, tls_config: Arc<rustls::ClientConfig>) -> Self {
|
||||
pub fn tls_config(mut self, tls_config: Arc<rustls::ClientConfig>) -> Self {
|
||||
self.config.tls_config = Some(TLSClientConfig(tls_config));
|
||||
self
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ fn tls_client_certificate() {
|
||||
.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
|
||||
|
||||
let agent = ureq::builder()
|
||||
.set_tls_config(std::sync::Arc::new(tls_config))
|
||||
.tls_config(std::sync::Arc::new(tls_config))
|
||||
.build();
|
||||
|
||||
let resp = agent.get("https://client.badssl.com/").call().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user