Object o = getMBeanAttribute(server, serverSocketFactoryObjName, "SSLSocketBuilder");
SSLSocketBuilderMBean sslSocketBuilder = (SSLSocketBuilderMBean) o;
if (sslSocketBuilder != null)
{
SSLSocketBuilder clonedSSLSocketBuilder = (SSLSocketBuilder) sslSocketBuilder.clone();
boolean shouldUseDefault = sslSocketBuilder.getUseSSLServerSocketFactory();
clonedSSLSocketBuilder.setUseSSLSocketFactory(shouldUseDefault);
boolean useClientMode = sslSocketBuilder.isServerSocketUseClientMode();
clonedSSLSocketBuilder.setSocketUseClientMode(useClientMode);
SSLSocketFactoryService sslSocketFactoryService = new SSLSocketFactoryService();
sslSocketFactoryService.setSSLSocketBuilder(clonedSSLSocketBuilder);
sslSocketFactoryService.start();
clientConfig.put(Remoting.CUSTOM_SOCKET_FACTORY, sslSocketFactoryService);
clientConfig.put(SSLSocketBuilder.REMOTING_SOCKET_USE_CLIENT_MODE, "false");