SSL / HTTPS Connection with Low Level Rest API? SSL / HTTPS Connection with Low Level Rest API? elasticsearch elasticsearch

SSL / HTTPS Connection with Low Level Rest API?


I solved it passing "https" while creating HttpPost object as third argument.

RestClient restClient = RestClient.builder(new HttpHost(esHost, esPort, "https"))            .setHttpClientConfigCallback(httpClientBuilder -> {                HttpAsyncClientBuilder httpAsyncClientBuilder = httpClientBuilder.setSSLContext(sslcontext);                return httpAsyncClientBuilder;            })            .build();

Now its working fine.