Skip to content

Commit 212efeb

Browse files
authored
Merge pull request TooTallNate#472 from marci4/master
Fix for TooTallNate#466
2 parents 56e0d75 + bd2060f commit 212efeb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/org/java_websocket/server/DefaultSSLWebSocketServerFactory.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import java.nio.channels.ByteChannel;
55
import java.nio.channels.SelectionKey;
66
import java.nio.channels.SocketChannel;
7+
import java.util.ArrayList;
8+
import java.util.Arrays;
79
import java.util.List;
810
import java.util.concurrent.ExecutorService;
911
import java.util.concurrent.Executors;
@@ -35,6 +37,15 @@ public DefaultSSLWebSocketServerFactory( SSLContext sslContext , ExecutorService
3537
@Override
3638
public ByteChannel wrapChannel( SocketChannel channel, SelectionKey key ) throws IOException {
3739
SSLEngine e = sslcontext.createSSLEngine();
40+
/**
41+
* See https://github.com/TooTallNate/Java-WebSocket/issues/466
42+
*
43+
* We remove TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 from the enabled ciphers since it is just available when you patch your java installation directly.
44+
* E.g. firefox requests this cipher and this causes some dcs/instable connections
45+
*/
46+
List<String> ciphers = new ArrayList<String>( Arrays.asList(e.getEnabledCipherSuites()));
47+
ciphers.remove("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
48+
e.setEnabledCipherSuites( ciphers.toArray(new String[]{}));
3849
e.setUseClientMode( false );
3950
return new SSLSocketChannel2( channel, e, exec, key );
4051
}

0 commit comments

Comments
 (0)