Skip to content

Commit 7d899b1

Browse files
Cédric Tabinok2c
authored andcommitted
Fixes Invalid Proxy exception when using a SSL client without Proxy
1 parent 542961b commit 7d899b1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public Socket createSocket(final HttpContext context) throws IOException {
205205

206206
@Override
207207
public Socket createSocket(final Proxy proxy, final HttpContext context) throws IOException {
208-
return new Socket(proxy);
208+
return proxy != null ? new Socket(proxy) : new Socket();
209209
}
210210

211211
@Override

0 commit comments

Comments
 (0)