tls: use rustls if both native-tls and rustls-tls are enabled (#586)
Co-authored-by: Alexis Mousset <contact@amousset.me>
This commit is contained in:
@@ -128,18 +128,12 @@ impl TlsParametersBuilder {
|
||||
/// depending on which one is available
|
||||
#[cfg(any(feature = "native-tls", feature = "rustls-tls"))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(feature = "native-tls", feature = "rustls-tls"))))]
|
||||
// TODO: remove below line once native-tls is supported with async-std
|
||||
#[allow(unreachable_code)]
|
||||
pub fn build(self) -> Result<TlsParameters, Error> {
|
||||
// TODO: remove once native-tls is supported with async-std
|
||||
#[cfg(all(feature = "rustls-tls", feature = "async-std1"))]
|
||||
#[cfg(feature = "rustls-tls")]
|
||||
return self.build_rustls();
|
||||
|
||||
#[cfg(feature = "native-tls")]
|
||||
#[cfg(not(feature = "rustls-tls"))]
|
||||
return self.build_native();
|
||||
|
||||
#[cfg(not(feature = "native-tls"))]
|
||||
return self.build_rustls();
|
||||
}
|
||||
|
||||
/// Creates a new `TlsParameters` using native-tls with the provided configuration
|
||||
|
||||
Reference in New Issue
Block a user