Moved form pull #153:
There seem to be problems on older android platforms because of this bug in SSLEngine : https://code.google.com/p/android/issues/detail?id=12955#c12. It appears that the only way this will work on these platforms is to abandon SSLEngine and use SSLSocket. Any chance of that happening?
Do you mean that your code is working fine but there is a problem with what i merged?
If there is a general problem i would like to know the exact exception or build error message and the android version you are working on.
The solution suggested in #141 might solve the problem.
Since this library heavily depends on the use of channels there is currently no way around the SSLEngine.
The only workaround would be to change the certificate in a way that the error does not occur as suggested in https://code.google.com/p/android/issues/detail?id=12955#c17
If someone indeed experiences this problem i will consider providing an android specific implementation of Java-Websockets which does not use channels.
For me it's a showstopper as Gingerbread comprises 47% of the Android market, and I can not change the SSL certs issued to me. I have changed Gottox socket.io-java client to use the AutoBahn websocket implementation and it is working for me.
it can work on java console.but can not work on android 2.3 .can solve this problem?
i found socket.io use this sdk.how thire solve this problem.
@ fg0711 do you use a self signed certificate?
#141 (comment) might help you.
But if https://code.google.com/p/android/issues/detail?id=12955#c12 causes your problem than i am afraid that there is nothing can do for you...
Can you post a stacktrace or give further information?
made websocket client use java.net instead of java.nio (addresses #88,
#155, #167, #175, #177, #187) (changes not yet fully tested)