private static void tlsConnectionReport(final HttpsURLConnection httpsConnection) throws Exception {
        val systemTrustManagers = getSystemTrustManagers();

        final Certificate[] certificates;
        try {
            certificates = httpsConnection.getServerCertificates();
        } catch (final SSLPeerUnverifiedException e) {
            LoggingUtils.error(LOGGER, e);
            throw new RuntimeException(e);
        }

        val serverCertificates =
            Arrays.copyOf(certificates, certificates.length, X509Certificate[].class);

        LOGGER.info("Server provided certs: ");
        for (val certificate : serverCertificates) {
            val validity = FunctionUtils.doAndHandle(
                o -> {
                    certificate.checkValidity();
                    return "valid";
                },
                e -> "invalid: " + e.getMessage()
            ).apply(certificate);

            LOGGER.info("\tsubject: [{}]", certificate.getSubjectDN().getName());
            LOGGER.info("\tissuer: [{}]", certificate.getIssuerDN().getName());
            LOGGER.info("\texpiration: [{}] - [{}] [{}]", certificate.getNotBefore(), certificate.getNotAfter(), validity);
            LOGGER.info("\ttrust anchor [{}]", checkTrustedCertStatus(certificate, systemTrustManagers));
            LOGGER.info("---");
        }
    }
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