diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2019-01-24 16:34:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-24 16:34:54 +0100 |
commit | 25f41d6c5fd105b47d9f0d0c1642f25fd9ac8795 (patch) | |
tree | b5e22db7bcee5a9d41da33f261c33f351307cad1 /security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java | |
parent | 1ed75a5681fc19966fdb1940f3f55e6c8f5c2c76 (diff) | |
parent | e9fb2bbd3ceb780b48c9aa60026f4f096ba2cc50 (diff) |
Merge pull request #8218 from vespa-engine/bjorncs/tls
bjorncs/tls
Diffstat (limited to 'security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java')
-rw-r--r-- | security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java b/security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java index 82caf02223f..c0e9e1053c3 100644 --- a/security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java +++ b/security-utils/src/main/java/com/yahoo/security/tls/TransportSecurityOptions.java @@ -13,6 +13,8 @@ import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.Optional; @@ -27,12 +29,14 @@ public class TransportSecurityOptions { private final Path certificatesFile; private final Path caCertificatesFile; private final AuthorizedPeers authorizedPeers; + private final List<String> acceptedCiphers; private TransportSecurityOptions(Builder builder) { this.privateKeyFile = builder.privateKeyFile; this.certificatesFile = builder.certificatesFile; this.caCertificatesFile = builder.caCertificatesFile; this.authorizedPeers = builder.authorizedPeers; + this.acceptedCiphers = builder.acceptedCiphers; } public Optional<Path> getPrivateKeyFile() { @@ -51,6 +55,8 @@ public class TransportSecurityOptions { return Optional.ofNullable(authorizedPeers); } + public List<String> getAcceptedCiphers() { return acceptedCiphers; } + public static TransportSecurityOptions fromJsonFile(Path file) { try (InputStream in = Files.newInputStream(file)) { return new TransportSecurityOptionsJsonSerializer().deserialize(in); @@ -83,6 +89,7 @@ public class TransportSecurityOptions { private Path certificatesFile; private Path caCertificatesFile; private AuthorizedPeers authorizedPeers; + private List<String> acceptedCiphers = new ArrayList<>(); public Builder() {} @@ -102,6 +109,11 @@ public class TransportSecurityOptions { return this; } + public Builder withAcceptedCiphers(List<String> acceptedCiphers) { + this.acceptedCiphers = acceptedCiphers; + return this; + } + public TransportSecurityOptions build() { return new TransportSecurityOptions(this); } @@ -114,6 +126,7 @@ public class TransportSecurityOptions { ", certificatesFile=" + certificatesFile + ", caCertificatesFile=" + caCertificatesFile + ", authorizedPeers=" + authorizedPeers + + ", acceptedCiphers=" + acceptedCiphers + '}'; } @@ -125,11 +138,12 @@ public class TransportSecurityOptions { return Objects.equals(privateKeyFile, that.privateKeyFile) && Objects.equals(certificatesFile, that.certificatesFile) && Objects.equals(caCertificatesFile, that.caCertificatesFile) && - Objects.equals(authorizedPeers, that.authorizedPeers); + Objects.equals(authorizedPeers, that.authorizedPeers) && + Objects.equals(acceptedCiphers, that.acceptedCiphers); } @Override public int hashCode() { - return Objects.hash(privateKeyFile, certificatesFile, caCertificatesFile, authorizedPeers); + return Objects.hash(privateKeyFile, certificatesFile, caCertificatesFile, authorizedPeers, acceptedCiphers); } }
\ No newline at end of file |