Cover change from past merges
[aaf/authz.git] / auth / auth-certman / src / main / java / org / onap / aaf / auth / cm / service / CMService.java
index f9cd060..259dfac 100644 (file)
@@ -164,22 +164,23 @@ 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) {
+                                                               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);
                                                        }
-
                                                }
                                        }
                                }