// Create the rmi socket factories for SSL
Map environment = new HashMap();
SSLContext context = createSSLContext();
environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, new SSLRMIClientSocketFactory());
environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, new SSLRMIServerSocketFactory(context));
// Create and start the RMIConnectorServer
JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, null);
ObjectName connectorServerName = ObjectName.getInstance("connectors:protocol=" + url.getProtocol());
server.registerMBean(connectorServer, connectorServerName);