From 6d60624cd3439f81030f7443e72cba21662e5d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Tabin?= Date: Thu, 23 Nov 2023 13:20:03 +0100 Subject: [PATCH] Fixes Invalid Proxy exception when using a SSL client without Proxy --- .../apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java index 4e80b4fa7..7ca209cb1 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java @@ -206,7 +206,7 @@ public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactor @Override public Socket createSocket(final Proxy proxy, final HttpContext context) throws IOException { - return new Socket(proxy); + return proxy != null ? new Socket(proxy) : new Socket(); } @Override