presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/client/ElasticsearchClient.java/ElasticsearchClient/createClient
class ElasticsearchClient:    private static RestHighLevelClient createClient(ElasticsearchConfig config, Optional<AwsSecurityConfig> awsSecurityConfig)
    {
        RestClientBuilder builder = RestClient.builder(
                new HttpHost(config.getHost(), config.getPort(), config.isTlsEnabled() ? "https" : "http"))
                .setRequestConfigCallback(
                        configBuilder -> configBuilder
                                .setConnectTimeout(toIntExact(config.getConnectTimeout().toMillis()))
                                .setSocketTimeout(toIntExact(config.getRequestTimeout().toMillis())))
                .setMaxRetryTimeoutMillis((int) config.getMaxRetryTime().toMillis());

        builder.setHttpClientConfigCallback(clientBuilder -> {
            if (config.isTlsEnabled()) {
                buildSslContext(config.getKeystorePath(), config.getKeystorePassword(), config.getTrustStorePath(), config.getTruststorePassword())
                        .ifPresent(clientBuilder::setSSLContext);

                if (config.isVerifyHostnames()) {
                    clientBuilder.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE);
                }
            }

            awsSecurityConfig.ifPresent(securityConfig -> clientBuilder.addInterceptorLast(new AwsRequestSigner(
                    securityConfig.getRegion(),
                    getAwsCredentialsProvider(securityConfig))));

            return clientBuilder;
        });

        return new RestHighLevelClient(builder);
    }