summaryrefslogtreecommitdiffstats
path: root/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf
diff options
context:
space:
mode:
Diffstat (limited to 'infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf')
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.groovy15
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/JettyServerProvider.groovy1
-rw-r--r--infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/RestconfModule.groovy7
3 files changed, 12 insertions, 11 deletions
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.groovy
index 6ce5a1555..388aa2bbe 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.groovy
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/HttpsConnectorProvider.groovy
@@ -11,9 +11,6 @@ import org.eclipse.jetty.util.ssl.SslContextFactory
class HttpsConnectorProvider extends ProviderTrait<ServerConnector> {
- public static final String KEYSTORE_PASSWORD = "OBF:1v9s1unr1unn1vv51zlk1t331vg91x1b1vgl1t331zly1vu51uob1uo71v8u"
- public static final String KEYSTORE_NAME = "/honeycomb-keystore"
-
@Inject
HoneycombConfiguration cfg
@Inject
@@ -32,12 +29,14 @@ class HttpsConnectorProvider extends ProviderTrait<ServerConnector> {
// openssl pkcs12 -inkey honeycomb.key -in honeycomb.crt -export -out honeycomb.pkcs12
// keytool -importkeystore -srckeystore honeycomb.pkcs12 -srcstoretype PKCS12 -destkeystore honeycomb-keystore
def sslContextFactory = new SslContextFactory()
- def keystoreURL = getClass().getResource(KEYSTORE_NAME)
+ def keystoreURL = getClass().getResource(cfg.restconfKeystore.get())
sslContextFactory.setKeyStorePath(keystoreURL.path)
- sslContextFactory.setKeyStorePassword(KEYSTORE_PASSWORD)
- sslContextFactory.setKeyManagerPassword(KEYSTORE_PASSWORD)
- sslContextFactory.setTrustStorePath(keystoreURL.path)
- sslContextFactory.setTrustStorePassword(KEYSTORE_PASSWORD)
+ sslContextFactory.setKeyStorePassword(cfg.keystorePassword.get())
+ sslContextFactory.setKeyManagerPassword((cfg.keystoreManagerPassword.get()))
+ def truststoreURL = getClass().getResource(cfg.restconfTruststore.get())
+ sslContextFactory.setTrustStorePath(truststoreURL.path)
+ sslContextFactory.setTrustStorePassword((cfg.truststorePassword.get()))
+ // TODO make this more configurable
sslContextFactory.setExcludeCipherSuites(
"SSL_RSA_WITH_DES_CBC_SHA",
"SSL_DHE_RSA_WITH_DES_CBC_SHA",
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/JettyServerProvider.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/JettyServerProvider.groovy
index ff6c300ea..14e6ae6f2 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/JettyServerProvider.groovy
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/JettyServerProvider.groovy
@@ -46,7 +46,6 @@ class JettyServerProvider extends ProviderTrait<Server> {
// Load Realm for basic auth
def service = new HashLoginService(REALM)
// Reusing the name as role
- // TODO make this more configurable
service.putUser(cfg.username, new Password(cfg.password), cfg.username)
server.addBean(service)
diff --git a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/RestconfModule.groovy b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/RestconfModule.groovy
index 4a66a1c3c..e8594a8c3 100644
--- a/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/RestconfModule.groovy
+++ b/infra/minimal-distribution/src/main/java/io/fd/honeycomb/infra/distro/restconf/RestconfModule.groovy
@@ -27,10 +27,13 @@ import org.opendaylight.netconf.sal.rest.api.RestConnector
@Slf4j
class RestconfModule extends AbstractModule {
+ public static final String RESTCONF_HTTP = "restconf-http"
+ public static final String RESTCONF_HTTPS = "restconf-https"
+
protected void configure() {
bind(Server).toProvider(JettyServerProvider).in(Singleton)
- bind(ServerConnector).annotatedWith(Names.named("restconf-http")).toProvider(HttpConnectorProvider).in(Singleton)
- bind(ServerConnector).annotatedWith(Names.named("restconf-https")).toProvider(HttpsConnectorProvider).in(Singleton)
+ bind(ServerConnector).annotatedWith(Names.named(RESTCONF_HTTP)).toProvider(HttpConnectorProvider).in(Singleton)
+ bind(ServerConnector).annotatedWith(Names.named(RESTCONF_HTTPS)).toProvider(HttpsConnectorProvider).in(Singleton)
bind(RestConnector).toProvider(RestconfProvider).in(Singleton)
}
}