summaryrefslogtreecommitdiffstats
path: root/auth/auth-certman/src
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-07-20 16:27:12 -0500
committerInstrumental <jonathan.gathman@att.com>2018-07-20 16:28:21 -0500
commit2cc0f0184c84281cf7bf683936c8c24f05d23fdb (patch)
tree66fbfd45f1b6b5aa81a414a2d0698830cd2b87ec /auth/auth-certman/src
parent15f3969cb88ce5576da368708dad1903828148f0 (diff)
Client Docs
Issue-ID: AAF-378 Change-Id: I6f20875b9159f7bc20e03234e5705332af092715 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-certman/src')
-rw-r--r--auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
index f9cd060b..744c3c3f 100644
--- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
+++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java
@@ -164,22 +164,25 @@ public class CMService {
} else {
for (String cn : req.value.fqdns) {
- try {
- InetAddress[] ias = InetAddress.getAllByName(cn);
- Set<String> potentialSanNames = new HashSet<>();
- for (InetAddress ia1 : ias) {
- InetAddress ia2 = InetAddress.getByAddress(ia1.getAddress());
- if (primary == null && ias.length == 1 && trans.ip().equals(ia1.getHostAddress())) {
- primary = ia1;
- } else if (!cn.equals(ia1.getHostName())
- && !ia2.getHostName().equals(ia2.getHostAddress())) {
- potentialSanNames.add(ia1.getHostName());
+ if(ignoreIPs) {
+ potentialSanNames.add(cn);
+ } else {
+ try {
+ InetAddress[] ias = InetAddress.getAllByName(cn);
+ Set<String> potentialSanNames = new HashSet<>();
+ for (InetAddress ia1 : ias) {
+ InetAddress ia2 = InetAddress.getByAddress(ia1.getAddress());
+ if (primary == null && ias.length == 1 && trans.ip().equals(ia1.getHostAddress())) {
+ primary = ia1;
+ } else if (!cn.equals(ia1.getHostName())
+ && !ia2.getHostName().equals(ia2.getHostAddress())) {
+ potentialSanNames.add(ia1.getHostName());
+ }
}
+ } catch (UnknownHostException e1) {
+ return Result.err(Result.ERR_BadData, "There is no DNS lookup for %s", cn);
}
- } catch (UnknownHostException e1) {
- return Result.err(Result.ERR_BadData, "There is no DNS lookup for %s", cn);
}
-
}
}
}