deepstreamIO / deepstream.io-client-java

The Java/Android Client for deepstream.io
Other
35 stars 37 forks source link

java client 2.2.0 BufferOverflowException if ssl cert is expired. #93

Open h3adache opened 7 years ago

h3adache commented 7 years ago

SSL cert was installed using the instructions from deepstream tutorials

Everything works fine but when the cert expired and client tries to connect. I get a BufferOverflowException without any other error/information and not any indication what the error was.

Exception in thread "Thread-10" java.nio.BufferOverflowException
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:363)
        at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:342)
        at sun.nio.ch.IOUtil.write(IOUtil.java:60)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
        at org.java_websocket.SSLSocketChannel2.close(SSLSocketChannel2.java:270)
        at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:453)
        at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:472)
        at org.java_websocket.WebSocketImpl.eot(WebSocketImpl.java:509)
        at org.java_websocket.client.WebSocketClient.interruptableRun(WebSocketClient.java:249)
        at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:188)
        at java.lang.Thread.run(Thread.java:745)

There's a possibly related issue on TooTallNate/Java-WebSocket#380

afiller commented 7 years ago

The same problem also occurs when the certificate is not "trustworthy". I tried it with an old version of the JDK which does not trust letsencrypt yet, and got the same error.

An appropriate exception would be good here.

h3adache commented 7 years ago

This is fixed in TooTallNate/Java-WebSocket now https://github.com/TooTallNate/Java-WebSocket/milestone/7

yasserf commented 7 years ago

Thanks for letting us know! We'll get out a release very shortly