@Override
    public void checkClientTrusted(final X509Certificate[] chain, final String authType) throws CertificateException {
        val trusted = this.trustManagers.stream().anyMatch(trustManager -> {
            try {
                trustManager.checkClientTrusted(chain, authType);
                return true;
            } catch (final CertificateException e) {
                val msg = "Unable to trust the client certificates [%s] for auth type [%s]: [%s]";
                if (LOGGER.isDebugEnabled()) {
                    val certs = Arrays.stream(chain).map(Certificate::toString).collect(Collectors.toSet());
                    LOGGER.debug(String.format(msg, certs, authType, e.getMessage()), e);
                }
                return false;
            }
        });

        if (!trusted) {
            throw new CertificateException("None of the TrustManagers can trust this client certificate chain");
        }
    }
This is {@link CompositeX509TrustManager}.
Represents an ordered list of {@link X509TrustManager}s with additive trust. If any one of the
composed managers trusts a certificate chain, then it is trusted by the composite manager.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ssl/CompositeX509TrustManager.java