diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-29 10:53:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 10:53:08 +0100 |
commit | b520261986e8a0444f2902396b15bf059a21004f (patch) | |
tree | e7fb71aa02e92de2f4a4018a5974f7e4f3bc5568 | |
parent | 6f46a56924ea740a628e4f9b8eda7ce0542cf5a1 (diff) | |
parent | 326d5340e6d7077a3eea7847434410a503deb98f (diff) |
Merge pull request #16285 from vespa-engine/balder/use-singleton
Use singleton already present.
-rw-r--r-- | jrt/src/com/yahoo/jrt/CryptoEngine.java | 6 | ||||
-rw-r--r-- | security-utils/src/main/java/com/yahoo/security/tls/DefaultTlsContext.java | 4 |
2 files changed, 1 insertions, 9 deletions
diff --git a/jrt/src/com/yahoo/jrt/CryptoEngine.java b/jrt/src/com/yahoo/jrt/CryptoEngine.java index 6d1955d7f66..318ee333fee 100644 --- a/jrt/src/com/yahoo/jrt/CryptoEngine.java +++ b/jrt/src/com/yahoo/jrt/CryptoEngine.java @@ -1,10 +1,7 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.jrt; - -import com.yahoo.security.tls.AuthorizationMode; import com.yahoo.security.tls.MixedMode; -import com.yahoo.security.tls.ConfigFileBasedTlsContext; import com.yahoo.security.tls.TlsContext; import com.yahoo.security.tls.TransportSecurityUtils; @@ -24,8 +21,7 @@ public interface CryptoEngine extends AutoCloseable { if (!TransportSecurityUtils.isTransportSecurityEnabled()) { return new NullCryptoEngine(); } - AuthorizationMode mode = TransportSecurityUtils.getInsecureAuthorizationMode(); - TlsContext tlsContext = new ConfigFileBasedTlsContext(TransportSecurityUtils.getConfigFile().get(), mode); + TlsContext tlsContext = TransportSecurityUtils.getSystemTlsContext().get(); TlsCryptoEngine tlsCryptoEngine = new TlsCryptoEngine(tlsContext); MixedMode mixedMode = TransportSecurityUtils.getInsecureMixedMode(); switch (mixedMode) { diff --git a/security-utils/src/main/java/com/yahoo/security/tls/DefaultTlsContext.java b/security-utils/src/main/java/com/yahoo/security/tls/DefaultTlsContext.java index def3e49be4d..d2a42d21973 100644 --- a/security-utils/src/main/java/com/yahoo/security/tls/DefaultTlsContext.java +++ b/security-utils/src/main/java/com/yahoo/security/tls/DefaultTlsContext.java @@ -43,10 +43,6 @@ public class DefaultTlsContext implements TlsContext { this(sslContext, TlsContext.ALLOWED_CIPHER_SUITES, peerAuthentication); } - public DefaultTlsContext(SSLContext sslContext) { - this(sslContext, TlsContext.ALLOWED_CIPHER_SUITES, PeerAuthentication.NEED); - } - DefaultTlsContext(SSLContext sslContext, Set<String> acceptedCiphers, PeerAuthentication peerAuthentication) { this.sslContext = sslContext; this.peerAuthentication = peerAuthentication; |