Source:
public String configureSecurityUsingVault(HostConfiguration hostConfig) { Map<String, String> vaultOptions = hostConfig.getVault(); if (vaultOptions == null) { return "Vault definition was not found in server configuration file"; } TruststoreConfig serverIdentity = hostConfig.getServerIdentityKeystore(); if (serverIdentity == null) { return "Could not find ssl configuration for management interface"; } Node sslNode = (Node) xpathExpression("/jboss-cli/ssl", XPathConstants.NODE); if (sslNode != null) { this.document.getDocumentElement().removeChild(sslNode); } sslNode = addChildElement(document.getDocumentElement(), "ssl"); sslNode.appendChild(createComment()); Node vaultNode = this.document.createElement("vault"); sslNode.appendChild(vaultNode); for (Entry<String, String> vaultOpt : vaultOptions.entrySet()) { Element opt = addChildElement(vaultNode, "vault-option"); opt.setAttribute("name", vaultOpt.getKey()); opt.setAttribute("value", vaultOpt.getValue()); } addChildElement(sslNode, "trust-store", serverIdentity.alias); addChildElement(sslNode, "trust-store", serverIdentity.path); addChildElement(sslNode, "trust-store-password", stripBrackets(serverIdentity.keystorePassword)); TruststoreConfig clientKeystore = hostConfig.getClientAuthenticationTruststore(); if (clientKeystore != null) { addChildElement(sslNode, "key-store", clientKeystore.path); addChildElement(sslNode, "key-store-password", stripBrackets(clientKeystore.keystorePassword)); addChildElement(sslNode, "key", stripBrackets(clientKeystore.keyPassword)); } return null; }

Target:
public String configureSecurityUsingVault(HostConfiguration hostConfig) { Map<String, String> vaultOptions = hostConfig.getVault(); if (vaultOptions == null) { return "Vault definition was not found in server configuration file"; } TruststoreConfig serverIdentity = hostConfig.getServerIdentityKeystore(); if (serverIdentity == null) { return "Could not find ssl configuration for management interface"; } JBossCliConstants constants = getCliConstants(); if (constants.version().compareTo("1.3") < 0) { return "Cannot store truststore passwords using vault, because it is not supported by this version of EAP"; } Node sslNode = (Node) xpathExpression("/jboss-cli/ssl", XPathConstants.NODE); if (sslNode != null) { this.document.getDocumentElement().removeChild(sslNode); } sslNode = addChildElement(document.getDocumentElement(), "ssl"); sslNode.appendChild(createComment()); Node vaultNode = this.document.createElement("vault"); sslNode.appendChild(vaultNode); for (Entry<String, String> vaultOpt : vaultOptions.entrySet()) { Element opt = addChildElement(vaultNode, "vault-option"); opt.setAttribute("name", vaultOpt.getKey()); opt.setAttribute("value", vaultOpt.getValue()); } addChildElement(sslNode, constants.alias(), serverIdentity.getAlias()); addChildElement(sslNode, constants.truststore(), serverIdentity.getPath()); addChildElement(sslNode, constants.truststorePassword(), stripBrackets(serverIdentity.getKeystorePassword())); TruststoreConfig clientKeystore = hostConfig.getClientAuthenticationTruststore(); if (clientKeystore != null) { addChildElement(sslNode, constants.keystore(), clientKeystore.getPath()); addChildElement(sslNode, constants.keystorePassword(), stripBrackets(clientKeystore.getKeystorePassword())); addChildElement(sslNode, constants.keyPassword(), stripBrackets(clientKeystore.getKeyPassword())); } return null; }