@@ -65,12 +65,11 @@ pub struct ZookeeperSecurity {
6565impl ZookeeperSecurity {
6666 // ports
6767 pub const CLIENT_PORT : u16 = 2181 ;
68- pub const CLIENT_PORT_NAME : & ' static str = "clientPort" ;
68+ pub const SECURE_CLIENT_PORT : u16 = 2282 ;
69+ pub const ADMIN_PORT : u16 = 8080 ;
6970 // directories
7071 pub const QUORUM_TLS_DIR : & ' static str = "/stackable/quorum_tls" ;
7172 pub const QUORUM_TLS_MOUNT_DIR : & ' static str = "/stackable/quorum_tls_mount" ;
72- pub const SECURE_CLIENT_PORT : u16 = 2282 ;
73- pub const SECURE_CLIENT_PORT_NAME : & ' static str = "secureClientPort" ;
7473 pub const SERVER_CNXN_FACTORY : & ' static str = "serverCnxnFactory" ;
7574 pub const SERVER_TLS_DIR : & ' static str = "/stackable/server_tls" ;
7675 pub const SERVER_TLS_MOUNT_DIR : & ' static str = "/stackable/server_tls_mount" ;
@@ -220,42 +219,6 @@ impl ZookeeperSecurity {
220219
221220 // Server TLS
222221 if self . tls_enabled ( ) {
223- // We set only the clientPort and portUnification here because otherwise there is a port bind exception
224- // See: https://issues.apache.org/jira/browse/ZOOKEEPER-4276
225- // --> Normally we would like to only set the secureClientPort (check out commented code below)
226- // What we tried:
227- // 1) Set clientPort and secureClientPort will fail with
228- // "static.config different from dynamic config .. "
229- // config.insert(
230- // Self::CLIENT_PORT_NAME.to_string(),
231- // CLIENT_PORT.to_string(),
232- // );
233- // config.insert(
234- // Self::SECURE_CLIENT_PORT_NAME.to_string(),
235- // SECURE_CLIENT_PORT.to_string(),
236- // );
237-
238- // 2) Setting only secureClientPort will config in the above mentioned bind exception.
239- // The NettyFactory tries to bind multiple times on the secureClientPort.
240- // config.insert(
241- // Self::SECURE_CLIENT_PORT_NAME.to_string(),
242- // self.client_port(.to_string()),
243- // );
244-
245- // 3) Using the clientPort and portUnification still allows plaintext connection without
246- // authentication, but at least TLS and authentication works when connecting securely.
247- config. insert (
248- Self :: CLIENT_PORT_NAME . to_string ( ) ,
249- self . client_port ( ) . to_string ( ) ,
250- ) ;
251- config. insert ( "client.portUnification" . to_string ( ) , "true" . to_string ( ) ) ;
252- // TODO: Remove clientPort and portUnification (above) in favor of secureClientPort once the bug is fixed
253- // config.insert(
254- // Self::SECURE_CLIENT_PORT_NAME.to_string(),
255- // self.client_port(.to_string()),
256- // );
257- // END TICKET
258-
259222 config. insert (
260223 Self :: SSL_HOST_NAME_VERIFICATION . to_string ( ) ,
261224 "true" . to_string ( ) ,
@@ -278,11 +241,6 @@ impl ZookeeperSecurity {
278241 {
279242 config. insert ( Self :: SSL_CLIENT_AUTH . to_string ( ) , "need" . to_string ( ) ) ;
280243 }
281- } else {
282- config. insert (
283- Self :: CLIENT_PORT_NAME . to_string ( ) ,
284- self . client_port ( ) . to_string ( ) ,
285- ) ;
286244 }
287245
288246 config
0 commit comments