@@ -25,11 +25,6 @@ pub struct Endpoint {
2525 pub ( crate ) rate_limit : Option < ( u64 , Duration ) > ,
2626 #[ cfg( feature = "tls" ) ]
2727 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 ,
3328 pub ( crate ) buffer_size : Option < usize > ,
3429 pub ( crate ) init_stream_window_size : Option < u32 > ,
3530 pub ( crate ) init_connection_window_size : Option < u32 > ,
@@ -256,18 +251,6 @@ impl Endpoint {
256251 } )
257252 }
258253
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-
271254 /// Set the value of `TCP_NODELAY` option for accepted connections. Enabled by default.
272255 pub fn tcp_nodelay ( self , enabled : bool ) -> Self {
273256 Endpoint {
@@ -320,16 +303,11 @@ impl Endpoint {
320303 }
321304
322305 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+ )
333311 }
334312
335313 /// Create a channel from this config.
@@ -435,8 +413,6 @@ impl From<Uri> for Endpoint {
435413 timeout : None ,
436414 #[ cfg( feature = "tls" ) ]
437415 tls : None ,
438- #[ cfg( feature = "tls-roots-common" ) ]
439- tls_assume_http2 : false ,
440416 buffer_size : None ,
441417 init_stream_window_size : None ,
442418 init_connection_window_size : None ,
0 commit comments