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

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


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

commit 099f0cb9191e8c581d891fcd67a91eae66cd7326
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  | 33 ----------------------
 1 file changed, 33 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 beee8d521d..27b7eef54a 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,7 +64,6 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import javax.net.ssl.SSLContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
@@ -76,12 +75,6 @@ import 
org.apache.commons.fileupload.servlet.ServletFileUpload;
 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;
@@ -1731,32 +1724,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