static ClickHouseNode probe(String host, int port, ClickHouseSslMode mode, String rootCaFile, String certFile,
            String keyFile, int timeout) {
        if (mode == null) {
            return probe(host, port, timeout);
        }

        Map<ClickHouseOption, Serializable> options = new HashMap<>();
        options.put(ClickHouseClientOption.SSL, true);
        options.put(ClickHouseClientOption.SSL_MODE, mode);
        options.put(ClickHouseClientOption.SSL_ROOT_CERTIFICATE, rootCaFile);
        options.put(ClickHouseClientOption.SSL_CERTIFICATE, certFile);
        options.put(ClickHouseClientOption.SSL_KEY, keyFile);
        ClickHouseConfig config = new ClickHouseConfig(options);
        SSLContext sslContext = null;
        try {
            sslContext = ClickHouseSslContextProvider.getProvider().getSslContext(SSLContext.class, config)
                    .orElse(null);
        } catch (SSLException e) {
            log.debug("Failed to create SSL context due to: %s", e.getMessage());
        }
        if (sslContext == null) {
            return probe(host, port, timeout);
        }

        SSLSocketFactory factory = sslContext.getSocketFactory();
        ClickHouseDnsResolver resolver = ClickHouseDnsResolver.getInstance();
        ClickHouseProtocol p = ClickHouseProtocol.HTTP;
        InetSocketAddress address = resolver != null
                ? resolver.resolve(ClickHouseProtocol.ANY, host, port)
                : new InetSocketAddress(host, port);
        try (SSLSocket client = (SSLSocket) factory.createSocket()) {
            client.setKeepAlive(false);
            client.setSoTimeout(timeout);
            client.connect(address, timeout);
            client.startHandshake();

            try (OutputStream out = client.getOutputStream(); InputStream in = client.getInputStream()) {
                out.write("GET /ping HTTP/1.1\r\n\r\n".getBytes(StandardCharsets.US_ASCII));
                out.flush();
                byte[] buf = new byte[12]; // HTTP/1.x xxx
                int read = in.read(buf);
                if (read == -1) {
                    p = ClickHouseProtocol.GRPC;
                } else if (buf[0] == 72 && buf[9] == 52) {
                    p = ClickHouseProtocol.TCP;
                }
            }
        } catch (IOException e) {
            // MYSQL does not support SSL
            // and PostgreSQL will end up with SocketTimeoutException
            log.debug("Failed to probe %s:%d", host, port, e);
        }
        return new ClickHouseNode(host, p, port, null, null, null);
    }
Creates a new node.

@return new node
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java