private static void testBadTlsConnection(final String url, final String proxy) {
        try {
            val urlConnection = createConnection(url, proxy);
            if (!(urlConnection instanceof final HttpsURLConnection httpsConnection)) {
                LOGGER.info("Not an TLS connection.");
                return;
            }

            httpsConnection.setSSLSocketFactory(getTheAllTrustingSSLContext().getSocketFactory());

            try (val reader = new InputStreamReader(httpsConnection.getInputStream(), StandardCharsets.UTF_8)) {
                tlsConnectionReport(httpsConnection);
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
    }
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