@@ -25,11 +25,6 @@ pub struct Endpoint {
25
25
pub ( crate ) rate_limit : Option < ( u64 , Duration ) > ,
26
26
#[ cfg( feature = "tls" ) ]
27
27
pub ( crate ) tls : Option < TlsConnector > ,
28
- // Only applies if the tls config is not explicitly set. This allows users
29
- // to connect to a server that doesn't support ALPN while using the
30
- // tls-roots-common feature for setting up TLS.
31
- #[ cfg( feature = "tls-roots-common" ) ]
32
- pub ( crate ) tls_assume_http2 : bool ,
33
28
pub ( crate ) buffer_size : Option < usize > ,
34
29
pub ( crate ) init_stream_window_size : Option < u32 > ,
35
30
pub ( crate ) init_connection_window_size : Option < u32 > ,
@@ -256,18 +251,6 @@ impl Endpoint {
256
251
} )
257
252
}
258
253
259
- /// Configures TLS to assume that the server offers HTTP/2 even if it
260
- /// doesn't perform ALPN negotiation. This only applies if a tls_config has
261
- /// not been set.
262
- #[ cfg( feature = "tls-roots-common" ) ]
263
- #[ cfg_attr( docsrs, doc( cfg( feature = "tls-roots-common" ) ) ) ]
264
- pub fn tls_assume_http2 ( self , assume_http2 : bool ) -> Self {
265
- Endpoint {
266
- tls_assume_http2 : assume_http2,
267
- ..self
268
- }
269
- }
270
-
271
254
/// Set the value of `TCP_NODELAY` option for accepted connections. Enabled by default.
272
255
pub fn tcp_nodelay ( self , enabled : bool ) -> Self {
273
256
Endpoint {
@@ -320,16 +303,11 @@ impl Endpoint {
320
303
}
321
304
322
305
pub ( crate ) fn connector < C > ( & self , c : C ) -> service:: Connector < C > {
323
- #[ cfg( all( feature = "tls" , not( feature = "tls-roots-common" ) ) ) ]
324
- let connector = service:: Connector :: new ( c, self . tls . clone ( ) ) ;
325
-
326
- #[ cfg( all( feature = "tls" , feature = "tls-roots-common" ) ) ]
327
- let connector = service:: Connector :: new ( c, self . tls . clone ( ) , self . tls_assume_http2 ) ;
328
-
329
- #[ cfg( not( feature = "tls" ) ) ]
330
- let connector = service:: Connector :: new ( c) ;
331
-
332
- connector
306
+ service:: Connector :: new (
307
+ c,
308
+ #[ cfg( feature = "tls" ) ]
309
+ self . tls . clone ( ) ,
310
+ )
333
311
}
334
312
335
313
/// Create a channel from this config.
@@ -435,8 +413,6 @@ impl From<Uri> for Endpoint {
435
413
timeout : None ,
436
414
#[ cfg( feature = "tls" ) ]
437
415
tls : None ,
438
- #[ cfg( feature = "tls-roots-common" ) ]
439
- tls_assume_http2 : false ,
440
416
buffer_size : None ,
441
417
init_stream_window_size : None ,
442
418
init_connection_window_size : None ,
0 commit comments