@Override
    public X509Certificate[] getAcceptedIssuers() {
        if (JiveGlobals.getBooleanProperty(ConnectionSettings.Server.TLS_ACCEPT_SELFSIGNED_CERTS, false)) {
            // Answer an empty list since we accept any issuer
            return new X509Certificate[0];
        }
        else {
            X509Certificate[] X509Certs = null;
            try {
                // See how many certificates are in the keystore.
                int numberOfEntry = trustStore.size();
                // If there are any certificates in the keystore.
                if (numberOfEntry > 0) {
                    // Create an array of X509Certificates
                    X509Certs = new X509Certificate[numberOfEntry];

                    // Get all of the certificate alias out of the keystore.
                    Enumeration<String> aliases = trustStore.aliases();

                    // Retrieve all of the certificates out of the keystore
                    // via the alias name.
                    int i = 0;
                    while (aliases.hasMoreElements()) {
                        X509Certs[i] =
                                (X509Certificate) trustStore.
                                        getCertificate(aliases.nextElement());
                        i++;
                    }

                }
            }
            catch (Exception e) {
                Log.error(e.getMessage(), e);
                X509Certs = null;
            }
            return X509Certs;
        }
    }
Given the partial or complete certificate chain provided by the peer, build a certificate
path to a trusted root and return if it can be validated and is trusted for server SSL
authentication based on the authentication type. The authentication type is the key
exchange algorithm portion of the cipher suites represented as a String, such as "RSA",
"DHE_DSS". Note: for some exportable cipher suites, the key exchange algorithm is
determined at run time during the handshake. For instance, for
TLS_RSA_EXPORT_WITH_RC4_40_MD5, the authType should be RSA_EXPORT when an ephemeral
RSA key is used for the key exchange, and RSA when the key from the server certificate
is used. Checking is case-sensitive.<p>

By default certificates are going to be verified. This includes verifying the certificate
chain, the root certificate and the certificates validity. However, it is possible to
disable certificates validation as a whole or each specific validation.

@param x509Certificates an ordered array of peer X.509 certificates with the peer's own
       certificate listed first and followed by any certificate authorities.
@param string the key exchange algorithm used.
@throws CertificateException if the certificate chain is not trusted by this TrustManager.
xmppserver/src/main/java/org/jivesoftware/openfire/net/ServerTrustManager.java