Added method to set the TLS connection builder (#116)
This allows configuring the accepted certs, client authentication, etc, when using the native TLS crate.
This commit is contained in:
@@ -18,6 +18,9 @@ use crate::{Error, Header, Request, Response};
|
||||
#[cfg(feature = "tls")]
|
||||
use crate::request::TLSClientConfig;
|
||||
|
||||
#[cfg(all(feature = "native-tls", not(feature = "tls")))]
|
||||
use crate::request::TLSConnector;
|
||||
|
||||
#[cfg(feature = "cookie")]
|
||||
use crate::pool::DEFAULT_HOST;
|
||||
|
||||
@@ -39,6 +42,8 @@ pub(crate) struct Unit {
|
||||
pub proxy: Option<Proxy>,
|
||||
#[cfg(feature = "tls")]
|
||||
pub tls_config: Option<TLSClientConfig>,
|
||||
#[cfg(all(feature = "native-tls", not(feature = "tls")))]
|
||||
pub tls_connector: Option<TLSConnector>,
|
||||
}
|
||||
|
||||
impl Unit {
|
||||
@@ -108,6 +113,8 @@ impl Unit {
|
||||
proxy: req.proxy.clone(),
|
||||
#[cfg(feature = "tls")]
|
||||
tls_config: req.tls_config.clone(),
|
||||
#[cfg(all(feature = "native-tls", not(feature = "tls")))]
|
||||
tls_connector: req.tls_connector.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user