You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2021/06/16 21:35:35 UTC

[qpid-broker-j] 02/02: QPID-8541: [Broker-J] Restore API backward compatibility

This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 7a064a475c1cea94a737d4dc4e8e8f0c99d61b2f
Author: Alex Rudyy <or...@apache.org>
AuthorDate: Wed Jun 16 17:15:01 2021 +0100

    QPID-8541: [Broker-J] Restore API backward compatibility
---
 .../apache/qpid/server/security/FileKeyStoreImpl.java    |  2 +-
 .../apache/qpid/server/security/FileTrustStoreImpl.java  |  2 +-
 .../server/transport/network/security/ssl/SSLUtil.java   | 16 +++++++++++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java
index 52df108..d23d4e3 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/FileKeyStoreImpl.java
@@ -137,7 +137,7 @@ public class FileKeyStoreImpl extends AbstractKeyStore<FileKeyStoreImpl> impleme
     {
         try
         {
-            _certificates = Collections.unmodifiableMap(SSLUtil.getCertificates(getInitializedKeyStore(this)));
+            _certificates = Collections.unmodifiableMap(SSLUtil.getCertificatesAsMap(getInitializedKeyStore(this)));
         }
         catch (GeneralSecurityException | IOException e)
         {
diff --git a/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java b/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
index e2f7342..76e4b0d 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/security/FileTrustStoreImpl.java
@@ -295,7 +295,7 @@ public class FileTrustStoreImpl extends AbstractTrustStore<FileTrustStoreImpl> i
         {
             final KeyStore ts = initializeKeyStore(this);
             trustManagers = createTrustManagers(ts);
-            certificates = Collections.unmodifiableMap(SSLUtil.getCertificates(ts));
+            certificates = Collections.unmodifiableMap(SSLUtil.getCertificatesAsMap(ts));
         }
         catch (Exception e)
         {
diff --git a/broker-core/src/main/java/org/apache/qpid/server/transport/network/security/ssl/SSLUtil.java b/broker-core/src/main/java/org/apache/qpid/server/transport/network/security/ssl/SSLUtil.java
index 2e62faa..ad13436 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/transport/network/security/ssl/SSLUtil.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/transport/network/security/ssl/SSLUtil.java
@@ -1053,7 +1053,21 @@ public class SSLUtil
 
     }
 
-    public static Map<String, Certificate> getCertificates(final KeyStore ks) throws KeyStoreException
+    /**
+     * Get keystore certificates
+     * @deprecated
+     * The signature of this method is changed in version 9.0 and onwards.
+     * <p> Use {@link SSLUtil#getCertificatesAsMap(KeyStore)} instead.
+     *
+     * @return cllection of keystore certificates
+     */
+    @Deprecated
+    public static Collection<Certificate> getCertificates(final KeyStore ks) throws KeyStoreException
+    {
+        return getCertificatesAsMap(ks).values();
+    }
+
+    public static Map<String, Certificate> getCertificatesAsMap(final KeyStore ks) throws KeyStoreException
     {
         final Map<String ,Certificate> certificates = new HashMap<>();
         final Enumeration<String> aliases = ks.aliases();

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org