accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch master updated: ACCUMULO-4678 Fix MonitorSslIT failure
Date Thu, 22 Feb 2018 19:34:44 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bb91ed  ACCUMULO-4678 Fix MonitorSslIT failure
7bb91ed is described below

commit 7bb91ede4804ce72b7dbf295588bdfa130599e0c
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Thu Feb 22 14:19:34 2018 -0500

    ACCUMULO-4678 Fix MonitorSslIT failure
---
 .../java/org/apache/accumulo/monitor/EmbeddedWebServer.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
index 6760952..42db013 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
@@ -38,7 +38,7 @@ public class EmbeddedWebServer {
   public EmbeddedWebServer(String host, int port) {
     server = new Server();
     final AccumuloConfiguration conf = Monitor.getContext().getConfiguration();
-    connector = new ServerConnector(server, getConnectionFactory(conf));
+    connector = new ServerConnector(server, getConnectionFactories(conf));
     connector.setHost(host);
     connector.setPort(port);
 
@@ -47,11 +47,12 @@ public class EmbeddedWebServer {
     handler.setContextPath("/");
   }
 
-  private static AbstractConnectionFactory getConnectionFactory(AccumuloConfiguration conf)
{
+  private static AbstractConnectionFactory[] getConnectionFactories(AccumuloConfiguration
conf) {
+    HttpConnectionFactory httpFactory = new HttpConnectionFactory();
     EnumSet<Property> requireForSecure = EnumSet.of(Property.MONITOR_SSL_KEYSTORE,
Property.MONITOR_SSL_KEYSTOREPASS, Property.MONITOR_SSL_TRUSTSTORE,
         Property.MONITOR_SSL_TRUSTSTOREPASS);
     if (requireForSecure.stream().map(p -> conf.get(p)).anyMatch(s -> s == null ||
s.isEmpty())) {
-      return new HttpConnectionFactory();
+      return new AbstractConnectionFactory[] {httpFactory};
     } else {
       SslContextFactory sslContextFactory = new SslContextFactory();
       sslContextFactory.setKeyStorePath(conf.get(Property.MONITOR_SSL_KEYSTORE));
@@ -76,7 +77,8 @@ public class EmbeddedWebServer {
         sslContextFactory.setIncludeProtocols(StringUtils.split(includeProtocols, ','));
       }
 
-      return new SslConnectionFactory(sslContextFactory, new HttpConnectionFactory().getProtocol());
+      SslConnectionFactory sslFactory = new SslConnectionFactory(sslContextFactory, httpFactory.getProtocol());
+      return new AbstractConnectionFactory[] {sslFactory, httpFactory};
     }
   }
 

-- 
To stop receiving notification emails like this one, please contact
ctubbsii@apache.org.

Mime
View raw message