summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@oath.com>2017-11-15 14:20:08 +0100
committerBjørn Christian Seime <bjorncs@oath.com>2017-11-15 14:31:47 +0100
commita7ad8187a2e0d1d50d5579ec90c21c86e474faa5 (patch)
treeda7e4297f2ea4cc0589a154caa34db990fe038bf /config-model/src/main/java/com/yahoo
parentec58719a0350a7127418025212ae9f7f811e2b98 (diff)
Configure default SslKeyStoreConfigurator in config-model's ConnectorFactory
Diffstat (limited to 'config-model/src/main/java/com/yahoo')
-rwxr-xr-xconfig-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java2
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/http/ConnectorFactory.java24
2 files changed, 15 insertions, 11 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java
index 274fb290f03..91d5b7fe267 100755
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java
@@ -27,7 +27,6 @@ import com.yahoo.container.handler.ThreadPoolProvider;
import com.yahoo.container.handler.ThreadpoolConfig;
import com.yahoo.container.jdisc.ContainerMbusConfig;
import com.yahoo.container.jdisc.JdiscBindingsConfig;
-import com.yahoo.container.jdisc.SslKeyStoreConfiguratorProvider;
import com.yahoo.container.jdisc.config.HealthMonitorConfig;
import com.yahoo.container.jdisc.config.MetricDefaultsConfig;
import com.yahoo.container.jdisc.messagebus.MbusServerProvider;
@@ -222,7 +221,6 @@ public final class ContainerCluster
addSimpleComponent(SIMPLE_LINGUISTICS_PROVIDER);
addSimpleComponent("com.yahoo.container.jdisc.SecretStoreProvider");
addSimpleComponent("com.yahoo.container.jdisc.CertificateStoreProvider");
- addSimpleComponent(SslKeyStoreConfiguratorProvider.class.getName());
addSimpleComponent("com.yahoo.container.jdisc.metric.MetricConsumerProviderProvider");
addSimpleComponent("com.yahoo.container.jdisc.metric.MetricProvider");
addSimpleComponent("com.yahoo.container.jdisc.metric.MetricUpdater");
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/http/ConnectorFactory.java b/config-model/src/main/java/com/yahoo/vespa/model/container/http/ConnectorFactory.java
index b4fdea75817..8be7bcf285f 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/http/ConnectorFactory.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/http/ConnectorFactory.java
@@ -4,6 +4,7 @@ package com.yahoo.vespa.model.container.http;
import com.yahoo.component.ComponentId;
import com.yahoo.container.bundle.BundleInstantiationSpecification;
import com.yahoo.jdisc.http.ConnectorConfig;
+import com.yahoo.jdisc.http.ssl.DefaultSslKeyStoreConfigurator;
import com.yahoo.osgi.provider.model.ComponentModel;
import com.yahoo.text.XML;
import com.yahoo.vespa.model.container.component.SimpleComponent;
@@ -13,8 +14,8 @@ import static com.yahoo.component.ComponentSpecification.fromString;
import static com.yahoo.jdisc.http.ConnectorConfig.Ssl.KeyStoreType;
/**
- * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
- * @since 5.21.0
+ * @author Einar M R Rosenvinge
+ * @author bjorncs
*/
public class ConnectorFactory extends SimpleComponent implements ConnectorConfig.Producer {
@@ -34,13 +35,7 @@ public class ConnectorFactory extends SimpleComponent implements ConnectorConfig
this.name = name;
this.listenPort = listenPort;
this.legacyConfig = legacyConfig;
- if (sslKeystoreConfigurator != null) {
- String className = sslKeystoreConfigurator.getAttribute("class");
- String bundleName = sslKeystoreConfigurator.getAttribute("bundle");
- SimpleComponent sslKeyStoreConfiguratorComponent =
- new SimpleComponent(new ComponentModel(name, className, bundleName));
- addChild(sslKeyStoreConfiguratorComponent);
- }
+ addChild(getSslKeyStoreConfigurator(name, sslKeystoreConfigurator));
}
@Override
@@ -153,4 +148,15 @@ public class ConnectorFactory extends SimpleComponent implements ConnectorConfig
this.listenPort = httpPort;
}
+ private static SimpleComponent getSslKeyStoreConfigurator(String name, Element sslKeystoreConfigurator) {
+ if (sslKeystoreConfigurator != null) {
+ String className = sslKeystoreConfigurator.getAttribute("class");
+ String bundleName = sslKeystoreConfigurator.getAttribute("bundle");
+ return new SimpleComponent(new ComponentModel(name, className, bundleName));
+ } else {
+ return new SimpleComponent(
+ new ComponentModel(name, DefaultSslKeyStoreConfigurator.class.getName(), "jdisc_http_service"));
+ }
+ }
+
}