Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormturtureanu2016-02-12 05:56:15 -0500
committermturtureanu2016-02-12 06:09:32 -0500
commit0b24b30bf929021a2723b74002166fdd9cab3874 (patch)
tree4cd88bc12a42e064770f975e7d71dc04033e2afb
parent5f519f1e3fd3861639434c97c116caf9c5047b26 (diff)
downloadorg.eclipse.hudson.core-0b24b30bf929021a2723b74002166fdd9cab3874.tar.gz
org.eclipse.hudson.core-0b24b30bf929021a2723b74002166fdd9cab3874.tar.xz
org.eclipse.hudson.core-0b24b30bf929021a2723b74002166fdd9cab3874.zip
Fixed issue which prevented starting Hudson exclusively on HTTPS
Signed-off-by: Mihai Turtureanu <turturel@gmail.com>
-rw-r--r--hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java b/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
index abe6a8e5..cf8afb3d 100644
--- a/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
+++ b/hudson-jetty-war-executable/src/main/java/org/eclipse/hudson/jetty/JettyLauncher.java
@@ -40,14 +40,17 @@ import org.eclipse.jetty.webapp.WebAppContext;
public class JettyLauncher {
private static String contextPath = "/";
+ private static final int CONNECTOR_DISABLED_PORT_VALUE = -1;
+ private static final int DEFAULT_HTTP_PORT_VALUE = 8080;
+ private static final int DEFAULT_HTTPS_PORT_VALUE = -1;
public static void start(String[] args, URL warUrl) throws Exception {
String httpListenAddress = "0.0.0.0";
String httpsListenAddress = "0.0.0.0";
- int httpPort = 8080;
- int httpsPort = -1;
+ int httpPort = DEFAULT_HTTP_PORT_VALUE;
+ int httpsPort = DEFAULT_HTTPS_PORT_VALUE;
String keyStorePath = null;
String keyStorePassword = null;
@@ -117,15 +120,17 @@ public class JettyLauncher {
HttpConfiguration http_config = new HttpConfiguration();
http_config.setOutputBufferSize(32768);
- ServerConnector httpConnector = new ServerConnector(server,
+ if (httpPort != CONNECTOR_DISABLED_PORT_VALUE) {
+ ServerConnector httpConnector = new ServerConnector(server,
new HttpConnectionFactory(http_config));
- httpConnector.setHost(httpListenAddress);
- httpConnector.setPort(httpPort);
- httpConnector.setIdleTimeout(30000);
+ httpConnector.setHost(httpListenAddress);
+ httpConnector.setPort(httpPort);
+ httpConnector.setIdleTimeout(30000);
- connectors.add(httpConnector);
+ connectors.add(httpConnector);
+ }
- if (httpsPort != -1) {
+ if (httpsPort != CONNECTOR_DISABLED_PORT_VALUE) {
SslContextFactory sslContextFactory = new SslContextFactory();
@@ -236,3 +241,4 @@ public class JettyLauncher {
return deleted;
}
}
+

Back to the top