Fix CADI Connection to Remote DNS AAF servers on proxied network
[aaf/authz.git] / cadi / core / src / main / java / org / onap / aaf / cadi / util / FixURIinfo.java
index 3943cdc..ff282ba 100644 (file)
@@ -46,6 +46,15 @@ public class FixURIinfo {
                 } else {
                     host = auth;
                     port = uri.getPort();
+                    if (port < 1) {
+                        if ("http".equals(uri.getScheme())) {
+                            port = 80;
+                        } else if ("https".equals(uri.getScheme())) {
+                            port = 443;
+                        } else {
+                            throw new RuntimeException ("Invalid scheme provided for URI " + uri);
+                        }
+                    }
                 }
                 auth=null;
             }