This is an automated email from the ASF dual-hosted git repository.

roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new e0a49b934 Just a minor
e0a49b934 is described below

commit e0a49b934f55e39b1d9289e021a5886a75f8438d
Author: Junfan Zhang <[email protected]>
AuthorDate: Wed Sep 17 19:24:17 2025 +0800

    Just a minor
---
 .../java/org/apache/uniffle/client/HttpClientFactory.java     | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/cli/src/main/java/org/apache/uniffle/client/HttpClientFactory.java 
b/cli/src/main/java/org/apache/uniffle/client/HttpClientFactory.java
index 201221e4d..56e6da50e 100644
--- a/cli/src/main/java/org/apache/uniffle/client/HttpClientFactory.java
+++ b/cli/src/main/java/org/apache/uniffle/client/HttpClientFactory.java
@@ -20,9 +20,7 @@ package org.apache.uniffle.client;
 import javax.net.ssl.SSLContext;
 
 import org.apache.http.client.config.RequestConfig;
-import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.conn.ssl.TrustStrategy;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.ssl.SSLContexts;
@@ -42,10 +40,11 @@ public class HttpClientFactory {
             .build();
     SSLConnectionSocketFactory sslSocketFactory;
     try {
-      TrustStrategy acceptingTrustStrategy = (cert, authType) -> true;
-      SSLContext sslContext =
-          SSLContexts.custom().loadTrustMaterial(null, 
acceptingTrustStrategy).build();
-      sslSocketFactory = new SSLConnectionSocketFactory(sslContext, 
NoopHostnameVerifier.INSTANCE);
+      // Use the JVM/system default truststore and perform hostname 
verification.
+      SSLContext sslContext = SSLContexts.createSystemDefault();
+      sslSocketFactory =
+          new SSLConnectionSocketFactory(
+              sslContext, 
SSLConnectionSocketFactory.getDefaultHostnameVerifier());
     } catch (Exception e) {
       LOG.error("Error: ", e);
       throw new UniffleRestException("Failed to create HttpClient", e);

Reply via email to