mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Patrick Diligent
23.16.2015 9066892d29000b912b1d83483719fc4d85dee0d8
OPENDJ-1842 (CR-6359) Using SSL with JMX doesn't work

allow jconsole to connect to the jmx connector when SSL is enabled. In addition, as a side effect, removes the constraint of providing OpenDJ.jar in the classpath. This is because the remote stub does not anymore depends on an OpendDJ specific class.

1 files deleted
2 files modified
355 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java 338 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/OpendsJmxConnector.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java
File was deleted
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/OpendsJmxConnector.java
@@ -159,18 +159,6 @@
   */
  public void connect(Map<String,?> env) throws IOException, SecurityException
  {
    // set the real target hostname
    DirectoryRMIClientSocketFactory.setServerHostname(serverHostname);
    // configure the thread-local connection environment
    if (env != null)
    {
      // encode credentials if necessary
      updateCredentials(env);
    }
    DirectoryRMIClientSocketFactory.setConnectionEnv(environment);
    jmxc.connect(env);
  }
opendj-server-legacy/src/main/java/org/opends/server/protocols/jmx/RmiConnector.java
@@ -42,6 +42,7 @@
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXServiceURL;
import javax.management.remote.rmi.RMIConnectorServer;
import javax.rmi.ssl.SslRMIClientSocketFactory;
import org.opends.server.api.KeyManagerProvider;
import org.opends.server.config.JMXMBean;
@@ -279,7 +280,7 @@
      // ---------------------
      // init an ssl context
      // ---------------------
      DirectoryRMIClientSocketFactory rmiClientSockeyFactory = null;
      SslRMIClientSocketFactory rmiClientSockeyFactory = null;
      DirectoryRMIServerSocketFactory rmiServerSockeyFactory = null;
      if (jmxConnectionHandler.isUseSSL())
      {
@@ -335,7 +336,7 @@
        // registry
        // ---------------------
        // Set the Client socket factory in the JMX map
        rmiClientSockeyFactory = new DirectoryRMIClientSocketFactory(false);
        rmiClientSockeyFactory = new SslRMIClientSocketFactory();
        env.put(
            "jmx.remote.rmi.client.socket.factory",
            rmiClientSockeyFactory);