Commit f146ead8 authored by daryl herzmann's avatar daryl herzmann

Merge pull request #136 from tevans/OF-857

OF-857: Properly configure Jetty connectors
parents 5c2f873f d83f7e6e
...@@ -121,10 +121,11 @@ public class AdminConsolePlugin implements Plugin { ...@@ -121,10 +121,11 @@ public class AdminConsolePlugin implements Plugin {
if (adminPort > 0) { if (adminPort > 0) {
httpConfig = new HttpConfiguration(); httpConfig = new HttpConfiguration();
httpConnector = new ServerConnector(adminServer, -1, serverThreads);
// Do not send Jetty info in HTTP headers // Do not send Jetty info in HTTP headers
httpConfig.setSendServerVersion( false ); httpConfig.setSendServerVersion( false );
httpConnector.addConnectionFactory(new HttpConnectionFactory(httpConfig)); httpConnector = new ServerConnector(adminServer, null, null, null, -1, serverThreads,
new HttpConnectionFactory(httpConfig));
// Listen on a specific network interface if it has been set. // Listen on a specific network interface if it has been set.
String bindInterface = getBindInterface(); String bindInterface = getBindInterface();
httpConnector.setHost(bindInterface); httpConnector.setHost(bindInterface);
...@@ -165,9 +166,8 @@ public class AdminConsolePlugin implements Plugin { ...@@ -165,9 +166,8 @@ public class AdminConsolePlugin implements Plugin {
HttpConnectionFactory httpConnectionFactory = new HttpConnectionFactory(httpsConfig); HttpConnectionFactory httpConnectionFactory = new HttpConnectionFactory(httpsConfig);
SslConnectionFactory sslConnectionFactory = new SslConnectionFactory(sslContextFactory, org.eclipse.jetty.http.HttpVersion.HTTP_1_1.toString()); SslConnectionFactory sslConnectionFactory = new SslConnectionFactory(sslContextFactory, org.eclipse.jetty.http.HttpVersion.HTTP_1_1.toString());
httpsConnector = new ServerConnector(adminServer, -1, serverThreads); httpsConnector = new ServerConnector(adminServer, null, null, null, -1, serverThreads,
httpsConnector.addConnectionFactory(sslConnectionFactory); sslConnectionFactory, httpConnectionFactory);
httpsConnector.addConnectionFactory(httpConnectionFactory);
} }
String bindInterface = getBindInterface(); String bindInterface = getBindInterface();
......
...@@ -200,8 +200,8 @@ public final class HttpBindManager { ...@@ -200,8 +200,8 @@ public final class HttpBindManager {
if (port > 0) { if (port > 0) {
HttpConfiguration httpConfig = new HttpConfiguration(); HttpConfiguration httpConfig = new HttpConfiguration();
configureProxiedConnector(httpConfig); configureProxiedConnector(httpConfig);
ServerConnector connector = new ServerConnector(httpBindServer, -1, bindThreads); ServerConnector connector = new ServerConnector(httpBindServer, null, null, null, -1, bindThreads,
connector.addConnectionFactory(new HttpConnectionFactory(httpConfig)); new HttpConnectionFactory(httpConfig));
// Listen on a specific network interface if it has been set. // Listen on a specific network interface if it has been set.
connector.setHost(getBindInterface()); connector.setHost(getBindInterface());
...@@ -253,9 +253,8 @@ public final class HttpBindManager { ...@@ -253,9 +253,8 @@ public final class HttpBindManager {
sslConnector = new HTTPSPDYServerConnector(httpBindServer, sslContextFactory); sslConnector = new HTTPSPDYServerConnector(httpBindServer, sslContextFactory);
} else { } else {
sslConnector = new ServerConnector(httpBindServer, -1, bindThreads); sslConnector = new ServerConnector(httpBindServer, null, null, null, -1, bindThreads,
sslConnector.addConnectionFactory(new SslConnectionFactory(sslContextFactory, "http/1.1")); new SslConnectionFactory(sslContextFactory, "http/1.1"), new HttpConnectionFactory(httpsConfig));
sslConnector.addConnectionFactory(new HttpConnectionFactory(httpsConfig));
} }
sslConnector.setHost(getBindInterface()); sslConnector.setHost(getBindInterface());
sslConnector.setPort(securePort); sslConnector.setPort(securePort);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment