From b96696014ecbee5ab1d912d2891b056e513c79ff Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Tue, 16 Jan 2024 13:05:09 -0700 Subject: [PATCH] Allow backwards-compatible createSocket calls --- .../hc/client5/http/socket/PlainConnectionSocketFactory.java | 2 +- .../apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java b/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java index 13495f9afd..ce2d8fb407 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java @@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() { @Override public Socket createSocket(final Proxy proxy, final HttpContext context) throws IOException { - return proxy != null ? new Socket(proxy) : new Socket(); + return proxy != null ? new Socket(proxy) : createSocket(context); } @Override 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 7ca209cb1e..9925c9a806 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 Socket createSocket(final HttpContext context) throws IOException { @Override public Socket createSocket(final Proxy proxy, final HttpContext context) throws IOException { - return proxy != null ? new Socket(proxy) : new Socket(); + return proxy != null ? new Socket(proxy) : createSocket(context); } @Override