diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2019-01-15 13:29:00 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2019-01-15 13:29:26 +0100 |
commit | d1486cc3cbac1bd0509c5e217dd94ec6b058aded (patch) | |
tree | f2997dbbb40297e970daca2732cdcbefcfca47aa /jrt/src/com/yahoo | |
parent | 5af45585f5359e2d3e52037f670146c24e0cfca1 (diff) |
Return default values when env vars are not present
Diffstat (limited to 'jrt/src/com/yahoo')
-rw-r--r-- | jrt/src/com/yahoo/jrt/CryptoEngine.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/jrt/src/com/yahoo/jrt/CryptoEngine.java b/jrt/src/com/yahoo/jrt/CryptoEngine.java index 0d1dfe8a22b..41a567a83f2 100644 --- a/jrt/src/com/yahoo/jrt/CryptoEngine.java +++ b/jrt/src/com/yahoo/jrt/CryptoEngine.java @@ -23,14 +23,13 @@ public interface CryptoEngine extends AutoCloseable { if (!TransportSecurityUtils.isTransportSecurityEnabled()) { return new NullCryptoEngine(); } - AuthorizationMode mode = TransportSecurityUtils.getInsecureAuthorizationMode().orElse(AuthorizationMode.ENFORCE); + AuthorizationMode mode = TransportSecurityUtils.getInsecureAuthorizationMode(); TlsContext tlsContext = new ReloadingTlsContext(TransportSecurityUtils.getConfigFile().get(), mode); TlsCryptoEngine tlsCryptoEngine = new TlsCryptoEngine(tlsContext); - if (!TransportSecurityUtils.isInsecureMixedModeEnabled()) { - return tlsCryptoEngine; - } - MixedMode mixedMode = TransportSecurityUtils.getInsecureMixedMode().get(); + MixedMode mixedMode = TransportSecurityUtils.getInsecureMixedMode(); switch (mixedMode) { + case DISABLED: + return tlsCryptoEngine; case PLAINTEXT_CLIENT_MIXED_SERVER: return new MaybeTlsCryptoEngine(tlsCryptoEngine, false); case TLS_CLIENT_MIXED_SERVER: |