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

mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d3f7ac954c Improved: Remove the unused UtilHttp.getAllowAllHttpClient 
(OFBIZ-13635)
d3f7ac954c is described below

commit d3f7ac954c23802e6b77f26a4c7a75f7b045ef1e
Author: Mridul Pathak <[email protected]>
AuthorDate: Sat Oct 3 12:34:38 2026 +0530

    Improved: Remove the unused UtilHttp.getAllowAllHttpClient (OFBIZ-13635)
    
    UtilHttp.getAllowAllHttpClient() created an HTTP client that trusts 
self-signed certificates and does not verify the host name. It was not used 
anywhere in the framework, the applications or the plugins, so it is removed 
together with the imports that only it needed.
---
 .../java/org/apache/ofbiz/base/util/UtilHttp.java  | 34 ----------------------
 1 file changed, 34 deletions(-)

diff --git 
a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java 
b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
index 1e9dafaff7..b8495d060a 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
@@ -64,8 +64,6 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import javax.net.ssl.SSLContext;
-
 import org.apache.commons.fileupload2.core.DiskFileItem;
 import org.apache.commons.fileupload2.core.DiskFileItemFactory;
 import org.apache.commons.fileupload2.core.FileItem;
@@ -74,12 +72,6 @@ import 
org.apache.commons.fileupload2.jakarta.JakartaServletFileUpload;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.http.NameValuePair;
 import org.apache.http.client.utils.URLEncodedUtils;
-import org.apache.http.conn.ssl.NoopHostnameVerifier;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.ssl.SSLContexts;
 import org.apache.ofbiz.entity.Delegator;
 import org.apache.ofbiz.entity.util.EntityUtilProperties;
 import org.apache.ofbiz.webapp.control.ConfigXMLReader;
@@ -1758,32 +1750,6 @@ public final class UtilHttp {
         response.setHeader("Content-Disposition", String.format("%s; 
filename=\"%s\"", dispositionType, filename));
     }
 
-    public static CloseableHttpClient getAllowAllHttpClient() {
-        return getAllowAllHttpClient("component://base/config/ofbizssl.jks", 
"changeit");
-    }
-
-    private static CloseableHttpClient getAllowAllHttpClient(String 
jksStoreFileName, String jksStorePassword) {
-        try {
-            // Trust own CA and all self-signed certs
-            SSLContext sslContext = SSLContexts.custom()
-                    .loadTrustMaterial(FileUtil.getFile(jksStoreFileName), 
jksStorePassword.toCharArray(),
-                            new TrustSelfSignedStrategy())
-                    .build();
-            // No host name verifier
-            SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
-                    sslContext,
-                    NoopHostnameVerifier.INSTANCE);
-            CloseableHttpClient httpClient = HttpClients.custom()
-                    .setSSLSocketFactory(sslsf)
-                    .build();
-            return httpClient;
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            return HttpClients.createDefault();
-        }
-    }
-
     public static String getMultiRowDelimiter() {
         return MULTI_ROW_DELIMITER;
     }

Reply via email to