private static X509TrustManager[] getSystemTrustManagers() throws Exception {
        val trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        trustManagerFactory.init((KeyStore) null);
        LOGGER.info("Detected Truststore: [{}]", trustManagerFactory.getProvider().getName());
        val trustManagers = trustManagerFactory.getTrustManagers();
        val x509TrustManagers = new ArrayList<X509TrustManager>(trustManagers.length);
        for (val trustManager : trustManagers) {
            if (trustManager instanceof final X509TrustManager x509TrustManager) {
                LOGGER.info("Trusted issuers found: [{}]", x509TrustManager.getAcceptedIssuers().length);
                x509TrustManagers.add(x509TrustManager);
            }
        }
        return x509TrustManagers.toArray(X509TrustManager[]::new);
    }
This is {@link ValidateEndpointCommand}.

@author Misagh Moayyed
@author John Gasper
@since 5.3.0
support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/util/ValidateEndpointCommand.java