@@ -24,17 +24,13 @@ ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
2424" ;
2525
2626enum ContextType {
27- WithMethod ( SslMethod ) ,
28- #[ cfg( feature = "rpk" ) ]
29- Rpk ,
27+ WithMethod ( SslMethod )
3028}
3129
3230#[ allow( clippy:: inconsistent_digit_grouping) ]
3331fn ctx ( ty : ContextType ) -> Result < SslContextBuilder , ErrorStack > {
3432 let mut ctx = match ty {
35- ContextType :: WithMethod ( method) => SslContextBuilder :: new ( method) ,
36- #[ cfg( feature = "rpk" ) ]
37- ContextType :: Rpk => SslContextBuilder :: new_rpk ( ) ,
33+ ContextType :: WithMethod ( method) => SslContextBuilder :: new ( method)
3834 } ?;
3935
4036 let mut opts = SslOptions :: ALL
@@ -99,17 +95,6 @@ impl SslConnector {
9995 Ok ( SslConnectorBuilder ( ctx) )
10096 }
10197
102- /// Creates a new builder for TLS connections with raw public key.
103- #[ cfg( feature = "rpk" ) ]
104- pub fn rpk_builder ( ) -> Result < SslConnectorBuilder , ErrorStack > {
105- let mut ctx = ctx ( ContextType :: Rpk ) ?;
106- ctx. set_cipher_list (
107- "DEFAULT:!aNULL:!eNULL:!MD5:!3DES:!DES:!RC4:!IDEA:!SEED:!aDSS:!SRP:!PSK" ,
108- ) ?;
109-
110- Ok ( SslConnectorBuilder ( ctx) )
111- }
112-
11398 /// Initiates a client-side TLS session on a stream.
11499 ///
115100 /// The domain is used for SNI and hostname verification.
@@ -231,13 +216,7 @@ impl ConnectConfiguration {
231216 self . ssl . set_hostname ( domain) ?;
232217 }
233218
234- #[ cfg( feature = "rpk" ) ]
235- let verify_hostname = !self . ssl . ssl_context ( ) . is_rpk ( ) && self . verify_hostname ;
236-
237- #[ cfg( not( feature = "rpk" ) ) ]
238- let verify_hostname = self . verify_hostname ;
239-
240- if verify_hostname {
219+ if self . verify_hostname {
241220 setup_verify_hostname ( & mut self . ssl , domain) ?;
242221 }
243222
@@ -299,21 +278,6 @@ impl DerefMut for ConnectConfiguration {
299278pub struct SslAcceptor ( SslContext ) ;
300279
301280impl SslAcceptor {
302- /// Creates a new builder configured to connect to clients that support Raw Public Keys.
303- #[ cfg( feature = "rpk" ) ]
304- pub fn rpk ( ) -> Result < SslAcceptorBuilder , ErrorStack > {
305- let mut ctx = ctx ( ContextType :: Rpk ) ?;
306- ctx. set_options ( SslOptions :: NO_TLSV1 | SslOptions :: NO_TLSV1_1 ) ;
307- let dh = Dh :: params_from_pem ( FFDHE_2048 . as_bytes ( ) ) ?;
308- ctx. set_tmp_dh ( & dh) ?;
309- ctx. set_cipher_list (
310- "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:\
311- ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:\
312- DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
313- ) ?;
314- Ok ( SslAcceptorBuilder ( ctx) )
315- }
316-
317281 /// Creates a new builder configured to connect to non-legacy clients. This should generally be
318282 /// considered a reasonable default choice.
319283 ///
0 commit comments