Repository: cxf-fediz Updated Branches: refs/heads/1.2.x-fixes b4410641c -> 0821461a0
Fix for failing to load the validation key after an initial failure Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/0821461a Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/0821461a Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/0821461a Branch: refs/heads/1.2.x-fixes Commit: 0821461a03a68bf9ab938f29258ec1f89345deec Parents: b441064 Author: Colm O hEigeartaigh <[email protected]> Authored: Mon Apr 11 17:18:36 2016 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Mon Apr 11 21:35:43 2016 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/fediz/core/config/FedizContext.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/0821461a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java ---------------------------------------------------------------------- diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java index e05d8bf..65b7fa9 100644 --- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java +++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.math.BigInteger; import java.security.cert.X509Certificate; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Properties; @@ -62,7 +63,7 @@ public class FedizContext implements Closeable { private String relativePath; private ReplayCache replayCache; private Protocol protocol; - private List<TrustManager> certificateStores; + private List<TrustManager> certificateStores = new ArrayList<TrustManager>(); private KeyManager keyManager; private KeyManager decryptionKeyManager; private ClassLoader classloader; @@ -96,10 +97,10 @@ public class FedizContext implements Closeable { } public List<TrustManager> getCertificateStores() { - if (certificateStores != null) { - return certificateStores; + if (!certificateStores.isEmpty()) { + return Collections.unmodifiableList(certificateStores); } - certificateStores = new ArrayList<TrustManager>(); + CertificateStores certStores = config.getCertificateStores(); List<TrustManagersType> trustManagers = certStores.getTrustManager(); for (TrustManagersType manager : trustManagers) { @@ -122,7 +123,7 @@ public class FedizContext implements Closeable { throw new IllegalConfigurationException("Failed to load keystore '" + tm.getName() + "'"); } } - return certificateStores; + return Collections.unmodifiableList(certificateStores); } public BigInteger getMaximumClockSkew() {
