FELIX-2772 Do not use HTTP or HTTPS if configured port number is less than or equal to zero even though the FELIX_HTTP[S]_ENABLE flag is true

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1056994 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
index 9233d71..6053b5e 100644
--- a/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
+++ b/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
@@ -93,9 +93,14 @@
         return this.debug;
     }
 
+    /**
+     * Returns <code>true</code> if HTTP is configured to be used (
+     * {@link #FELIX_HTTP_ENABLE}) and
+     * the configured HTTP port ({@link #HTTP_PORT}) is higher than zero.
+     */
     public boolean isUseHttp()
     {
-        return this.useHttp;
+        return this.useHttp && getHttpPort() > 0;
     }
 
     public boolean isUseHttpNio()
@@ -103,9 +108,14 @@
         return this.useHttpNio;
     }
 
+    /**
+     * Returns <code>true</code> if HTTPS is configured to be used (
+     * {@link #FELIX_HTTPS_ENABLE}) and
+     * the configured HTTP port ({@link #HTTPS_PORT}) is higher than zero.
+     */
     public boolean isUseHttps()
     {
-        return this.useHttps;
+        return this.useHttps && getHttpsPort() > 0;
     }
 
     public boolean isUseHttpsNio()