summaryrefslogtreecommitdiffstats
path: root/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-05-19 17:16:34 -0400
committerEndi S. Dewata <edewata@redhat.com>2015-05-22 18:10:07 -0400
commit8c2fb0b89be2216f91d9e250850a27e40e4dbd7f (patch)
tree34da936712a1e02398b05486f1549bc23977054c /base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
parentdc6f5768e815f6a8bf4cb971f1603a84945699cc (diff)
downloadpki-8c2fb0b89be2216f91d9e250850a27e40e4dbd7f.tar.gz
pki-8c2fb0b89be2216f91d9e250850a27e40e4dbd7f.tar.xz
pki-8c2fb0b89be2216f91d9e250850a27e40e4dbd7f.zip
Cleaned up log messages in ConfigurationUtils.getPortFromSecurityDomain().
https://fedorahosted.org/pki/ticket/1372
Diffstat (limited to 'base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java')
-rw-r--r--base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
index 1765ba7a6..5bad42d8e 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
@@ -2498,7 +2498,7 @@ public class ConfigurationUtils {
CMS.debug("ConfigurationUtils: injectSAN="+injectSAN);
if (certTag.equals("sslserver") &&
injectSAN == true) {
- sslserver_extension =
+ sslserver_extension =
CertUtil.buildSANSSLserverURLExtension(config);
}
@@ -2722,29 +2722,41 @@ public class ConfigurationUtils {
public static int getPortFromSecurityDomain(String domainXML, String host, int port, String csType,
String givenTag, String wantedTag) throws SAXException, IOException, ParserConfigurationException {
+
+ CMS.debug("ConfigurationUtils: Searching for " + wantedTag + " in " + csType + " hosts");
+
IConfigStore cs = CMS.getConfigStore();
ByteArrayInputStream bis = new ByteArrayInputStream(domainXML.getBytes());
XMLObject parser = new XMLObject(bis);
Document doc = parser.getDocument();
+
NodeList nodeList = doc.getElementsByTagName(csType);
// save domain name in cfg
cs.putString("securitydomain.name", parser.getValue("Name"));
int len = nodeList.getLength();
- CMS.debug("len: "+ len);
for (int i = 0; i < len; i++) {
Node node = nodeList.item(i);
+
String v_host = parser.getValuesFromContainer(node, "Host").elementAt(0);
- CMS.debug("v_host " + v_host);
+ CMS.debug("ConfigurationUtils: host: " + v_host);
+
String v_given_port = parser.getValuesFromContainer(node, givenTag).elementAt(0);
- CMS.debug("v_port " + v_given_port);
+ CMS.debug("ConfigurationUtils: " + givenTag + " port: " + v_given_port);
+
if (!(v_host.equals(host) && v_given_port.equals(port + "")))
continue;
+
+ // v_host == host || v_given_port != port
+
String wanted_port = parser.getValuesFromContainer(node, wantedTag).elementAt(0);
+ CMS.debug("ConfigurationUtils: " + wantedTag + " port found: " + wanted_port);
+
return Integer.parseInt(wanted_port);
}
+ CMS.debug("ConfigurationUtils: " + wantedTag + " port not found");
return 0;
}