Source:
private static void addSSLContext(ManagementClient managementClient, File directory, String keystoreFilename, String[] keyStore, String[] keyManager, String truststoreFilename, String[] trustStore, String[] trustManager, String[] sslContext1) { try { ModelNode credential = new ModelNode(); credential.get("clear-text").set("123456"); ModelNode modelNode = createAddOperation(createAddress(keyStore)); modelNode.get("type").set("JKS"); modelNode.get("path").set(new File(directory, keystoreFilename).getAbsolutePath()); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(keyManager)); modelNode.get("algorithm").set("SunX509"); modelNode.get("key-store").set(keyStore[keyStore.length - 1]); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(trustStore)); modelNode.get("type").set("JKS"); modelNode.get("path").set(new File(directory, truststoreFilename).getAbsolutePath()); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(trustManager)); modelNode.get("algorithm").set("SunX509"); modelNode.get("key-store").set(trustStore[trustStore.length - 1]); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(sslContext1)); modelNode.get("key-manager").set(keyManager[keyManager.length - 1]); modelNode.get("trust-manager").set(trustManager[trustManager.length - 1]); modelNode.get("protocols").set(new ModelNode().add("TLSv1.2")); if (trustManager[trustManager.length - 1].contains("twoWayTM")) { modelNode.get("need-client-auth").set(true); } Assert.assertTrue(managementClient.getControllerClient().execute(modelNode).asString().contains("\"outcome\" => \"success\"")); } catch (IOException e) { Assert.fail(); } }

Target:
private static void addSSLContext(ManagementClient managementClient, File directory, String keystoreFilename, String[] keyStore, String[] keyManager, String truststoreFilename, String[] trustStore, String[] trustManager, String[] sslContext1) { try { ModelNode credential = new ModelNode(); credential.get("clear-text").set("123456"); ModelNode modelNode = createAddOperation(createAddress(keyStore)); modelNode.get("type").set(JKS); modelNode.get("path").set(new File(directory, keystoreFilename).getAbsolutePath()); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(keyManager)); modelNode.get("algorithm").set("SunX509"); modelNode.get("key-store").set(keyStore[keyStore.length - 1]); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(trustStore)); modelNode.get("type").set(JKS); modelNode.get("path").set(new File(directory, truststoreFilename).getAbsolutePath()); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(trustManager)); modelNode.get("algorithm").set("SunX509"); modelNode.get("key-store").set(trustStore[trustStore.length - 1]); modelNode.get("credential-reference").set(credential); managementClient.getControllerClient().execute(modelNode); modelNode = createAddOperation(createAddress(sslContext1)); modelNode.get("key-manager").set(keyManager[keyManager.length - 1]); modelNode.get("trust-manager").set(trustManager[trustManager.length - 1]); modelNode.get("protocols").set(new ModelNode().add("TLSv1.2")); if (trustManager[trustManager.length - 1].contains("twoWayTM")) { modelNode.get("need-client-auth").set(true); } Assert.assertTrue(managementClient.getControllerClient().execute(modelNode).asString().contains("\"outcome\" => \"success\"")); } catch (IOException e) { Assert.fail(); } }