Skip to content

Commit

Permalink
OpenSearchConnection: use built-in TrustAllStrategy
Browse files Browse the repository at this point in the history
no need to hand-roll this if there's a built-in alternative.
  • Loading branch information
rursprung committed Nov 22, 2024
1 parent 38f7fd8 commit 7b90a70
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder;
import org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.TrustAllStrategy;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.nio.ssl.TlsStrategy;
import org.apache.hc.core5.reactor.ssl.TlsDetails;
Expand Down Expand Up @@ -144,7 +145,7 @@ private void connect() {
try {
sslcontext = SSLContextBuilder
.create()
.loadTrustMaterial(null, (chains, authType) -> true)
.loadTrustMaterial(null, new TrustAllStrategy())
.build();
} catch (final NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 7b90a70

Please sign in to comment.