1- #[ cfg( any( feature = "native -tls" , feature = "__rustls" , ) ) ]
1+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" , ) ) ]
22use std:: any:: Any ;
33use std:: future:: Future ;
44use std:: net:: IpAddr ;
@@ -42,15 +42,15 @@ use crate::tls::CertificateRevocationList;
4242use crate :: tls:: { self , TlsBackend } ;
4343#[ cfg( feature = "__tls" ) ]
4444use crate :: Certificate ;
45- #[ cfg( any( feature = "native -tls" , feature = "__rustls" ) ) ]
45+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" ) ) ]
4646use crate :: Identity ;
4747use crate :: { IntoUrl , Method , Proxy , Url } ;
4848
4949use http:: header:: { Entry , HeaderMap , HeaderValue , ACCEPT , PROXY_AUTHORIZATION , USER_AGENT } ;
5050use http:: uri:: Scheme ;
5151use http:: Uri ;
5252use hyper_util:: client:: legacy:: connect:: HttpConnector ;
53- #[ cfg( feature = "native -tls" ) ]
53+ #[ cfg( feature = "__native -tls" ) ]
5454use native_tls_crate:: TlsConnector ;
5555use pin_project_lite:: pin_project;
5656#[ cfg( feature = "http3" ) ]
@@ -176,7 +176,7 @@ struct Config {
176176 tcp_keepalive_retries : Option < u32 > ,
177177 #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
178178 tcp_user_timeout : Option < Duration > ,
179- #[ cfg( any( feature = "native -tls" , feature = "__rustls" ) ) ]
179+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" ) ) ]
180180 identity : Option < Identity > ,
181181 proxies : Vec < ProxyMatcher > ,
182182 auto_sys_proxy : bool ,
@@ -312,7 +312,7 @@ impl ClientBuilder {
312312 root_certs : Vec :: new ( ) ,
313313 #[ cfg( feature = "__tls" ) ]
314314 tls_certs_only : false ,
315- #[ cfg( any( feature = "native -tls" , feature = "__rustls" ) ) ]
315+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" ) ) ]
316316 identity : None ,
317317 #[ cfg( feature = "__rustls" ) ]
318318 crls : vec ! [ ] ,
@@ -516,11 +516,11 @@ impl ClientBuilder {
516516
517517 #[ cfg( feature = "__tls" ) ]
518518 match config. tls {
519- #[ cfg( feature = "native -tls" ) ]
519+ #[ cfg( feature = "__native -tls" ) ]
520520 TlsBackend :: NativeTls => {
521521 let mut tls = TlsConnector :: builder ( ) ;
522522
523- #[ cfg( all( feature = "native -tls-alpn" , not( feature = "http3" ) ) ) ]
523+ #[ cfg( all( feature = "__native -tls-alpn" , not( feature = "http3" ) ) ) ]
524524 {
525525 match config. http_version_pref {
526526 HttpVersionPref :: Http1 => {
@@ -548,13 +548,13 @@ impl ClientBuilder {
548548 cert. add_to_native_tls ( & mut tls) ;
549549 }
550550
551- #[ cfg( feature = "native -tls" ) ]
551+ #[ cfg( feature = "__native -tls" ) ]
552552 {
553553 if let Some ( id) = config. identity {
554554 id. add_to_native_tls ( & mut tls) ?;
555555 }
556556 }
557- #[ cfg( all( feature = "__rustls" , not( feature = "native -tls" ) ) ) ]
557+ #[ cfg( all( feature = "__rustls" , not( feature = "__native -tls" ) ) ) ]
558558 {
559559 // Default backend + rustls Identity doesn't work.
560560 if let Some ( _id) = config. identity {
@@ -606,7 +606,7 @@ impl ClientBuilder {
606606 config. tls_info ,
607607 ) ?
608608 }
609- #[ cfg( feature = "native -tls" ) ]
609+ #[ cfg( feature = "__native -tls" ) ]
610610 TlsBackend :: BuiltNativeTls ( conn) => ConnectorBuilder :: from_built_native_tls (
611611 http,
612612 conn,
@@ -861,7 +861,7 @@ impl ClientBuilder {
861861 config. tls_info ,
862862 )
863863 }
864- #[ cfg( any( feature = "native -tls" , feature = "__rustls" , ) ) ]
864+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" , ) ) ]
865865 TlsBackend :: UnknownPreconfigured => {
866866 return Err ( crate :: error:: builder (
867867 "Unknown TLS backend passed to `use_preconfigured_tls`" ,
@@ -1918,7 +1918,7 @@ impl ClientBuilder {
19181918 ///
19191919 /// This requires the optional `native-tls` or `rustls(-...)` feature to be
19201920 /// enabled.
1921- #[ cfg( any( feature = "native -tls" , feature = "__rustls" ) ) ]
1921+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" ) ) ]
19221922 #[ cfg_attr( docsrs, doc( cfg( any( feature = "native-tls" , feature = "rustls" ) ) ) ) ]
19231923 pub fn identity ( mut self , identity : Identity ) -> ClientBuilder {
19241924 self . config . identity = Some ( identity) ;
@@ -2087,15 +2087,15 @@ impl ClientBuilder {
20872087 /// # Optional
20882088 ///
20892089 /// This requires the optional `native-tls` feature to be enabled.
2090- #[ cfg( feature = "native -tls" ) ]
2090+ #[ cfg( feature = "__native -tls" ) ]
20912091 #[ cfg_attr( docsrs, doc( cfg( feature = "native-tls" ) ) ) ]
20922092 pub fn tls_backend_native ( mut self ) -> ClientBuilder {
20932093 self . config . tls = TlsBackend :: NativeTls ;
20942094 self
20952095 }
20962096
20972097 /// Deprecated: use [`ClientBuilder::tls_backend_native()`] instead.
2098- #[ cfg( feature = "native -tls" ) ]
2098+ #[ cfg( feature = "__native -tls" ) ]
20992099 pub fn use_native_tls ( self ) -> ClientBuilder {
21002100 self . tls_backend_native ( )
21012101 }
@@ -2147,11 +2147,11 @@ impl ClientBuilder {
21472147 ///
21482148 /// This requires one of the optional features `native-tls` or
21492149 /// `rustls(-...)` to be enabled.
2150- #[ cfg( any( feature = "native -tls" , feature = "__rustls" , ) ) ]
2150+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" , ) ) ]
21512151 #[ cfg_attr( docsrs, doc( cfg( any( feature = "native-tls" , feature = "rustls" ) ) ) ) ]
21522152 pub fn tls_backend_preconfigured ( mut self , tls : impl Any ) -> ClientBuilder {
21532153 let mut tls = Some ( tls) ;
2154- #[ cfg( feature = "native -tls" ) ]
2154+ #[ cfg( feature = "__native -tls" ) ]
21552155 {
21562156 if let Some ( conn) = ( & mut tls as & mut dyn Any ) . downcast_mut :: < Option < TlsConnector > > ( ) {
21572157 let tls = conn. take ( ) . expect ( "is definitely Some" ) ;
@@ -2178,7 +2178,7 @@ impl ClientBuilder {
21782178 }
21792179
21802180 /// Deprecated: use [`ClientBuilder::tls_backend_preconfigured()`] instead.
2181- #[ cfg( any( feature = "native -tls" , feature = "__rustls" , ) ) ]
2181+ #[ cfg( any( feature = "__native -tls" , feature = "__rustls" , ) ) ]
21822182 pub fn use_preconfigured_tls ( self , tls : impl Any ) -> ClientBuilder {
21832183 self . tls_backend_preconfigured ( tls)
21842184 }
0 commit comments