diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-09-12 11:26:18 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-09-12 11:26:18 +0200 |
commit | c9a3e05f486f7dde2a4f7895a8adcfd54518c108 (patch) | |
tree | 7ec074835478efc6a34393c7f50aa158c1727c14 /jdisc_http_service/src/main/java/com/yahoo/jdisc/http/ssl/DefaultSslTrustStoreConfigurator.java | |
parent | 7f00722a620ed17116253d61d89728e63bed2299 (diff) |
Remove SslKeyStoreConfigurator/SslTrustStoreConfigurator concept
Diffstat (limited to 'jdisc_http_service/src/main/java/com/yahoo/jdisc/http/ssl/DefaultSslTrustStoreConfigurator.java')
-rw-r--r-- | jdisc_http_service/src/main/java/com/yahoo/jdisc/http/ssl/DefaultSslTrustStoreConfigurator.java | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/ssl/DefaultSslTrustStoreConfigurator.java b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/ssl/DefaultSslTrustStoreConfigurator.java deleted file mode 100644 index 5a8c399e6ba..00000000000 --- a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/ssl/DefaultSslTrustStoreConfigurator.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.jdisc.http.ssl; - -import com.google.inject.Inject; -import com.yahoo.jdisc.http.ConnectorConfig; - -/** - * @author bjorncs - */ -public class DefaultSslTrustStoreConfigurator implements SslTrustStoreConfigurator { - - @SuppressWarnings("deprecation") - private final com.yahoo.jdisc.http.SecretStore secretStore; - private final ConnectorConfig.Ssl config; - - @Inject - @SuppressWarnings("deprecation") - public DefaultSslTrustStoreConfigurator(ConnectorConfig config, com.yahoo.jdisc.http.SecretStore secretStore) { - validateConfig(config.ssl()); - this.secretStore = secretStore; - this.config = config.ssl(); - } - - @Override - public void configure(SslTrustStoreContext context) { - if (!config.enabled()) return; - String keyDbPassword = config.keyDbKey(); - if (!config.trustStorePath().isEmpty()) { - String password = config.useTrustStorePassword() ? secretStore.getSecret(keyDbPassword) : null; - context.updateTrustStore(config.trustStorePath(), config.trustStoreType().toString(), password); - } - } - - private static void validateConfig(ConnectorConfig.Ssl config) { - if (!config.enabled()) return; - if (!config.trustStorePath().isEmpty() && config.useTrustStorePassword() && config.keyDbKey().isEmpty()) { - throw new IllegalArgumentException("Missing password for JKS truststore"); - } - } - -} |