diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2017-10-12 11:36:11 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2017-10-12 11:36:16 +0200 |
commit | be860d36892d3df7c2b8235db0794dc8091ff0a7 (patch) | |
tree | bbe5a5151047fc8909ae9dfc49db77de834ad40f /container-disc/src/main/java/com/yahoo/container/jdisc | |
parent | 4dae8f7765189e999e9c3010ab8b55eea9d3ca40 (diff) |
Add back SslKeyStoreFactoryProvider as a temporary workaround
Some applications use unsafe config features
that breaks when removing a component from the config-model.
Diffstat (limited to 'container-disc/src/main/java/com/yahoo/container/jdisc')
-rw-r--r-- | container-disc/src/main/java/com/yahoo/container/jdisc/SslKeyStoreFactoryProvider.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/SslKeyStoreFactoryProvider.java b/container-disc/src/main/java/com/yahoo/container/jdisc/SslKeyStoreFactoryProvider.java new file mode 100644 index 00000000000..64773af905e --- /dev/null +++ b/container-disc/src/main/java/com/yahoo/container/jdisc/SslKeyStoreFactoryProvider.java @@ -0,0 +1,41 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.container.jdisc; + +import com.yahoo.container.di.componentgraph.Provider; +import com.yahoo.jdisc.http.ssl.ReaderForPath; +import com.yahoo.jdisc.http.ssl.SslKeyStore; +import com.yahoo.jdisc.http.ssl.SslKeyStoreFactory; + +/** + * An SSL key store provider which provides a factory which throws exception on + * invocation as no SSL key store is currently provided by default. + * The purpose of this is to provide a ssl store factory for injection in the case where + * no secret store component is provided. + * + * @author bratseth + */ +public class SslKeyStoreFactoryProvider implements Provider<SslKeyStoreFactory> { + + private static final ThrowingSslKeyStoreFactory instance = new ThrowingSslKeyStoreFactory(); + + @Override + public SslKeyStoreFactory get() { return instance; } + + @Override + public void deconstruct() { } + + private static final class ThrowingSslKeyStoreFactory implements SslKeyStoreFactory { + + @Override + public SslKeyStore createKeyStore(ReaderForPath certificateFile, ReaderForPath keyFile) { + throw new UnsupportedOperationException("A SSL key store factory component is not available"); + } + + @Override + public SslKeyStore createTrustStore(ReaderForPath certificateFile) { + throw new UnsupportedOperationException("A SSL key store factory component is not available"); + } + + } + +} |