@@ -14,7 +14,6 @@ pub struct ClientTlsConfig {
1414 domain : Option < String > ,
1515 cert : Option < Certificate > ,
1616 identity : Option < Identity > ,
17- rustls_raw : Option < tokio_rustls:: rustls:: ClientConfig > ,
1817}
1918
2019#[ cfg( feature = "tls" ) ]
@@ -36,7 +35,6 @@ impl ClientTlsConfig {
3635 domain : None ,
3736 cert : None ,
3837 identity : None ,
39- rustls_raw : None ,
4038 }
4139 }
4240
@@ -49,8 +47,6 @@ impl ClientTlsConfig {
4947 }
5048
5149 /// Sets the CA Certificate against which to verify the server's TLS certificate.
52- ///
53- /// This has no effect if `rustls_client_config` is used to configure Rustls.
5450 pub fn ca_certificate ( self , ca_certificate : Certificate ) -> Self {
5551 ClientTlsConfig {
5652 cert : Some ( ca_certificate) ,
@@ -59,35 +55,18 @@ impl ClientTlsConfig {
5955 }
6056
6157 /// Sets the client identity to present to the server.
62- ///
63- /// This has no effect if `rustls_client_config` is used to configure Rustls.
6458 pub fn identity ( self , identity : Identity ) -> Self {
6559 ClientTlsConfig {
6660 identity : Some ( identity) ,
6761 ..self
6862 }
6963 }
7064
71- /// Use options specified by the given `ClientConfig` to configure TLS.
72- ///
73- /// This overrides all other TLS options set via other means.
74- pub fn rustls_client_config ( self , config : tokio_rustls:: rustls:: ClientConfig ) -> Self {
75- ClientTlsConfig {
76- rustls_raw : Some ( config) ,
77- ..self
78- }
79- }
80-
8165 pub ( crate ) fn tls_connector ( & self , uri : Uri ) -> Result < TlsConnector , crate :: Error > {
8266 let domain = match & self . domain {
8367 None => uri. host ( ) . ok_or_else ( Error :: new_invalid_uri) ?. to_string ( ) ,
8468 Some ( domain) => domain. clone ( ) ,
8569 } ;
86- match & self . rustls_raw {
87- None => {
88- TlsConnector :: new_with_rustls_cert ( self . cert . clone ( ) , self . identity . clone ( ) , domain)
89- }
90- Some ( c) => TlsConnector :: new_with_rustls_raw ( c. clone ( ) , domain) ,
91- }
70+ TlsConnector :: new ( self . cert . clone ( ) , self . identity . clone ( ) , domain)
9271 }
9372}
0 commit comments