Skip to content

Commit

Permalink
Retrieve default SSL socket factory to reconcile the configuration wi…
Browse files Browse the repository at this point in the history
…th jdk.tls.client.protocols
  • Loading branch information
Pavel Treutner committed Jan 16, 2024
1 parent 9dce7a8 commit d4365d4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/java_websocket/client/WebSocketClient.java
Expand Up @@ -45,7 +45,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSession;
Expand Down Expand Up @@ -543,9 +542,7 @@ private void upgradeSocketToSSL()
if (socketFactory instanceof SSLSocketFactory) {
factory = (SSLSocketFactory) socketFactory;
} else {
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, null);
factory = sslContext.getSocketFactory();
factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
}
socket = factory.createSocket(socket, uri.getHost(), getPort(), true);
}
Expand Down

0 comments on commit d4365d4

Please sign in to comment.