Skip to content

Commit 6d60624

Browse files
Cédric Tabinok2c
authored andcommitted
Fixes Invalid Proxy exception when using a SSL client without Proxy
1 parent 83d603c commit 6d60624

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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
@@ -206,7 +206,7 @@ public Socket createSocket(final HttpContext context) throws IOException {
206206

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

212212
@Override

0 commit comments

Comments
 (0)