@ShellMethod(key = "validate-endpoint", value = "Test connections to an endpoint to verify connectivity, SSL, etc")
    public boolean validateEndpoint(
        @ShellOption(value = {"url", "--url"},
            help = "Endpoint URL to test")
        final String url,
        @ShellOption(value = {"proxy", "--proxy"},
            help = "Proxy address to use when testing the endpoint url",
            defaultValue = StringUtils.EMPTY)
        final String proxy,
        @ShellOption(value = {"timeout", "--timeout"},
            help = "Timeout to use in milliseconds when testing the url",
            defaultValue = "5000")
        final int timeout) {

        try {
            LOGGER.info("Trying to connect to [{}]", url);
            val conn = createConnection(url, proxy);

            LOGGER.info("Setting connection timeout to [{}]", timeout);
            conn.setConnectTimeout(timeout);

            try (val reader = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8);
                 val in = new BufferedReader(reader)) {
                in.readLine();

                if (conn instanceof final HttpURLConnection instance) {
                    val code = instance.getResponseCode();
                    LOGGER.info("Response status code received: [{}]", code);
                }
                LOGGER.info("Successfully connected to url [{}]", url);
                return true;
            }
        } catch (final Exception e) {
            LOGGER.info("Could not connect to the host address [{}]", url);
            LOGGER.info("The error is: [{}]", e.getMessage());
            LOGGER.info("Here are the details:");
            LOGGER.error(consolidateExceptionMessages(e));
            testBadTlsConnection(url, proxy);
        }
        return false;
    }
Validate endpoint.

@param url     the url
@param proxy   the proxy
@param timeout the timeout
@return true /false
support/cas-server-support-shell-core/src/main/java/org/apereo/cas/shell/commands/util/ValidateEndpointCommand.java