smiklosovic commented on code in PR #3638: URL: https://github.com/apache/cassandra/pull/3638#discussion_r1826595163
########## test/distributed/org/apache/cassandra/distributed/impl/IsolatedJmx.java: ########## @@ -84,14 +87,17 @@ public void startJmx() { String hostname = addr.getHostAddress(); wrapper = new MBeanWrapper.InstanceMBeanWrapper(hostname + ":" + jmxPort); ((MBeanWrapper.DelegatingMbeanWrapper) MBeanWrapper.instance).setDelegate(wrapper); - Map<String, Object> env = new HashMap<>(); - serverSocketFactory = new CollectingRMIServerSocketFactoryImpl(addr); - env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, - serverSocketFactory); - clientSocketFactory = new RMIClientSocketFactoryImpl(addr); - env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, - clientSocketFactory); + // CASSANDRA-18508: Sensitive JMX SSL configuration options can be easily exposed + Map<String,Object> encryptionOptionsMap = (Map<String, Object>) config.getParams().get("jmx_encryption_options"); + EncryptionOptions jmxEncryptionOptions = getJmxEncryptionOptions(encryptionOptionsMap); + // Here the `localOnly` is always passed as true as it is for the local isolated JMX testing + // However if the `jmxEncryptionOptions` are provided or JMX SSL configuration is set it will configure + // the socket factories appropriately. + Map<String, Object> socketFactories = new IsolatedJmxSocketFactory().configure(addr, true, jmxEncryptionOptions); + serverSocketFactory = (RMICloseableServerSocketFactory) socketFactories.get(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE); Review Comment: @maulin-vasavada do we still need to cast? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org