Java-WebSocket: Problems with WSS running on linux and Edge(or ie) browser

Hello,

I’m having a bit of a issue. On my local environment, when i create the server and try to run it, i can connect correctly with all browsers, thanks to fix #466 , However, when i export to my test server, that runs Ubuntu, PHP 7,1 and apache2, i simple cant make it work with Edge or IE. Using Firefox and Chrome works correctly. I’m using oracle-java8 on the server… java -version returns: java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

The problem happens when i try to connect with the server via Edge or IE. It freezes and time out on the client, but the server dont show me anything… However, if i close the tab before it times out, the server spill a exception: java.io.IOException: Broken pipe at sun.nio.ch.FileDispatcherImpl.write0(Native Method) at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) at sun.nio.ch.IOUtil.write(IOUtil.java:65) at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) at org.java_websocket.SSLSocketChannel2.close(SSLSocketChannel2.java:319) at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:492) at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:522) at org.java_websocket.server.WebSocketServer.handleIOException(WebSocketServer.java:494) at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:424) at java.lang.Thread.run(Thread.java:748)

I just cant make it work. Please help me again @marci4 =D

PS: My server is running on : 35.xxx.223.xxx:8283

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23

Most upvoted comments

Hello @marci4 ,

I removed the cipher, but it is still a no go… However, i decided to chalange this issue! When i removed (TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) Edge picked a new one(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) so i removed this too, and it picked a new one(TLS_RSA_WITH_AES_128_GCM_SHA256) and so on…

At the end, i removed some ciphers, and finally i can tell you its working on Firefox, Edge, Chrome and IE.

However, i still have some problems with the new sslSocketChannel, some times on all browsers i need to restart the connection, causing the exeption i already have mentioned.

At the end, my WrapChannel method is like this:

`public ByteChannel wrapChannel(SocketChannel channel, SelectionKey key) throws IOException {
    SSLEngine e = sslcontext.createSSLEngine();
    /*
     * See https://github.com/TooTallNate/Java-WebSocket/issues/466
     *
     * 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. E.g. firefox requests this cipher and this
     * causes some dcs/instable connections
     */
    List<String> ciphers = new ArrayList<String>(Arrays.asList(e.getEnabledCipherSuites()));
   // Recomendend ciphers to remove
    ciphers.remove("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
    ciphers.remove("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");
    ciphers.remove("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384");
    ciphers.remove("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA");
    ciphers.remove("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384");
    ciphers.remove("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256");
    ciphers.remove("TLS_DHE_RSA_WITH_AES_256_CBC_SHA");
   //Ciphers removed on my own
    ciphers.remove("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256");
    ciphers.remove("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA");
    ciphers.remove("TLS_RSA_WITH_AES_128_GCM_SHA256");
    ciphers.remove("TLS_RSA_WITH_AES_128_CBC_SHA256");
    ciphers.remove("TLS_RSA_WITH_AES_128_CBC_SHA");
    //edge is using now -> SSL_RSA_WITH_3DES_EDE_CBC_SHA
    e.setEnabledCipherSuites(ciphers.toArray(new String[]{}));
    e.setUseClientMode(false);
    return new SSLSocketChannel(channel, e, exec, key);
}`