@@ -12,7 +12,7 @@ use std::{
1212 time:: Duration ,
1313} ;
1414
15- use aliases:: { BoxedClientService , BoxedClientServiceLayer , GenericClientService , ResponseBody } ;
15+ use aliases:: { BoxedClientLayer , BoxedClientService , GenericClientService , ResponseBody } ;
1616pub use future:: Pending ;
1717use http:: {
1818 Request as HttpRequest , Response as HttpResponse ,
@@ -143,15 +143,15 @@ struct Config {
143143 http_version_pref : HttpVersionPref ,
144144 https_only : bool ,
145145 http2_max_retry : usize ,
146- request_layers : Option < Vec < BoxedClientServiceLayer > > ,
146+ layers : Option < Vec < BoxedClientLayer > > ,
147147 connector_layers : Option < Vec < BoxedConnectorLayer > > ,
148- tls_keylog_policy : Option < KeyLogPolicy > ,
148+ keylog_policy : Option < KeyLogPolicy > ,
149149 tls_info : bool ,
150150 tls_sni : bool ,
151- tls_verify_hostname : bool ,
152- tls_identity : Option < Identity > ,
153- tls_cert_store : CertStore ,
154- tls_cert_verification : bool ,
151+ verify_hostname : bool ,
152+ identity : Option < Identity > ,
153+ cert_store : CertStore ,
154+ cert_verification : bool ,
155155 min_tls_version : Option < TlsVersion > ,
156156 max_tls_version : Option < TlsVersion > ,
157157 transport_options : TransportOptions ,
@@ -210,15 +210,15 @@ impl ClientBuilder {
210210 http_version_pref : HttpVersionPref :: All ,
211211 https_only : false ,
212212 http2_max_retry : 2 ,
213- request_layers : None ,
213+ layers : None ,
214214 connector_layers : None ,
215- tls_keylog_policy : None ,
215+ keylog_policy : None ,
216216 tls_info : false ,
217217 tls_sni : true ,
218- tls_verify_hostname : true ,
219- tls_identity : None ,
220- tls_cert_store : CertStore :: default ( ) ,
221- tls_cert_verification : true ,
218+ verify_hostname : true ,
219+ identity : None ,
220+ cert_store : CertStore :: default ( ) ,
221+ cert_verification : true ,
222222 min_tls_version : None ,
223223 max_tls_version : None ,
224224 // Transport options for HTTP/1/2 and TLS.
@@ -297,11 +297,11 @@ impl ClientBuilder {
297297 . max_version ( config. max_tls_version )
298298 . min_version ( config. min_tls_version )
299299 . tls_sni ( config. tls_sni )
300- . verify_hostname ( config. tls_verify_hostname )
301- . cert_verification ( config. tls_cert_verification )
302- . cert_store ( config. tls_cert_store )
303- . identity ( config. tls_identity )
304- . keylog ( config. tls_keylog_policy )
300+ . verify_hostname ( config. verify_hostname )
301+ . cert_verification ( config. cert_verification )
302+ . cert_store ( config. cert_store )
303+ . identity ( config. identity )
304+ . keylog ( config. keylog_policy )
305305 } ;
306306
307307 Connector :: builder ( proxies. clone ( ) , resolver)
@@ -382,7 +382,7 @@ impl ClientBuilder {
382382 ) ) )
383383 . service ( service) ;
384384
385- match config. request_layers {
385+ match config. layers {
386386 Some ( layers) => {
387387 let service = layers. into_iter ( ) . fold (
388388 BoxCloneSyncService :: new ( service) ,
@@ -1067,7 +1067,7 @@ impl ClientBuilder {
10671067 /// Sets the identity to be used for client certificate authentication.
10681068 #[ inline]
10691069 pub fn identity ( mut self , identity : Identity ) -> ClientBuilder {
1070- self . config . tls_identity = Some ( identity) ;
1070+ self . config . identity = Some ( identity) ;
10711071 self
10721072 }
10731073
@@ -1077,7 +1077,7 @@ impl ClientBuilder {
10771077 /// for TLS connections. By default, the system's verify certificate store is used.
10781078 #[ inline]
10791079 pub fn cert_store ( mut self , store : CertStore ) -> ClientBuilder {
1080- self . config . tls_cert_store = store;
1080+ self . config . cert_store = store;
10811081 self
10821082 }
10831083
@@ -1094,7 +1094,7 @@ impl ClientBuilder {
10941094 /// as a last resort.
10951095 #[ inline]
10961096 pub fn cert_verification ( mut self , cert_verification : bool ) -> ClientBuilder {
1097- self . config . tls_cert_verification = cert_verification;
1097+ self . config . cert_verification = cert_verification;
10981098 self
10991099 }
11001100
@@ -1108,7 +1108,7 @@ impl ClientBuilder {
11081108 /// introduces a significant vulnerability to man-in-the-middle attacks.
11091109 #[ inline]
11101110 pub fn verify_hostname ( mut self , verify_hostname : bool ) -> ClientBuilder {
1111- self . config . tls_verify_hostname = verify_hostname;
1111+ self . config . verify_hostname = verify_hostname;
11121112 self
11131113 }
11141114
@@ -1124,7 +1124,7 @@ impl ClientBuilder {
11241124 /// Configures TLS key logging policy for the client.
11251125 #[ inline]
11261126 pub fn keylog ( mut self , policy : KeyLogPolicy ) -> ClientBuilder {
1127- self . config . tls_keylog_policy = Some ( policy) ;
1127+ self . config . keylog_policy = Some ( policy) ;
11281128 self
11291129 }
11301130
@@ -1243,10 +1243,7 @@ impl ClientBuilder {
12431243 <L :: Service as Service < HttpRequest < Body > > >:: Future : Send + ' static ,
12441244 {
12451245 let layer = BoxCloneSyncServiceLayer :: new ( layer) ;
1246- self . config
1247- . request_layers
1248- . get_or_insert_default ( )
1249- . push ( layer) ;
1246+ self . config . layers . get_or_insert_default ( ) . push ( layer) ;
12501247 self
12511248 }
12521249
0 commit comments