File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -93,11 +93,13 @@ https://hc.apache.org/httpcomponents-asyncclient-dev/httpasyncclient/apidocs/org
93
93
94
94
[source,java]
95
95
--------------------------------------------------
96
- KeyStore keyStore = KeyStore.getInstance("jks");
96
+ KeyStore truststore = KeyStore.getInstance("jks");
97
97
try (InputStream is = Files.newInputStream(keyStorePath)) {
98
- keyStore .load(is, keyStorePass.toCharArray());
98
+ truststore .load(is, keyStorePass.toCharArray());
99
99
}
100
- RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200))
100
+ SSLContextBuilder sslBuilder = SSLContexts.custom().loadTrustMaterial(truststore, null);
101
+ final SSLContext sslContext = sslBuilder.build();
102
+ RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200, "https"))
101
103
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
102
104
@Override
103
105
public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
You can’t perform that action at this time.
0 commit comments