Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wss error handshake #146

Open
mi4uu opened this issue Nov 22, 2017 · 10 comments
Open

wss error handshake #146

mi4uu opened this issue Nov 22, 2017 · 10 comments
Labels

Comments

@mi4uu
Copy link

mi4uu commented Nov 22, 2017

Hi,
I have big problem.
I cant connect on wss.
this is what i got on onException:

meteor: exception: java.lang.Exception: com.neovisionaries.ws.client.WebSocketException: Failed to get the input stream of the raw socket: Handshake failed

and this is how I'm connecting to my server:

    mMeteor = new Meteor(this, "wss://beholder.com.pl/websocket");

    // register the callback that will handle events and receive messages
    mMeteor.addCallback(this);

    // establish the connection
    mMeteor.connect();

best Regards
Mike

@ocram ocram added the question label Nov 24, 2017
@ocram
Copy link
Contributor

ocram commented Nov 24, 2017

Failed to get the input stream of the raw socket: Handshake failed

I think the message of this com.neovisionaries.ws.client.WebSocketException has been pretty clear, especially the last part. The question is then why the handshake has failed.

Your sequence of calls and your backend URL look good, and the server’s response is fine too – at least temporarily, perhaps it was different back when this failed.

So if you connect using ws instead wss, everything works without problems? Can you check which Meteor version you’re using?

@theshook
Copy link

Hi, if I try on the other android device it works fine some other device send me handshake fail

@ocram
Copy link
Contributor

ocram commented Feb 20, 2018

@theshook What are the exact Android versions of the respective devices?

@theshook
Copy link

If I try on samsung s5 lollipop OS then the error will come out, but if I try on the zenfone3 Oreo there is no error

@ocram
Copy link
Contributor

ocram commented Feb 21, 2018

@theshook That might mean Android 5 with its TLS stack is too old. Can you try Android 6 or 7 perhaps? Apart from that, can you check what this tool does say for Android 5 vs Android 7 in the “Handshake Simulation” section? What is the provider of your TLS certificate? Could it be that Android 5 does not trust the certificate while Android 8 does?

@theshook
Copy link

hi! I'm using meteor-now to deploy my application. yes, I tried on other android version and it works fine android 7. Is there other solution regarding my problem?
meteor-now uses https://zeit.co/ and if you deploy a website there for free it ends with ".now.sh" by the way I used the tool that you include in your comment and here are the results
image

@theshook
Copy link

image

@ocram
Copy link
Contributor

ocram commented Feb 24, 2018

@theshook Thanks! It seems this is because the server does not support TLS 1.0 or because it lacks the cipher suites that Android 5 supports. Maybe this helps. Alternatively, you could fork the library and its sample and check if you can connect if you modify WebSocketFactory and its SSL/TLS settings as described here.

@rizwan321
Copy link

rizwan321 commented Mar 14, 2018

has any one found the solution. i am getting the same error. i am trying app on nexus 5 having OS 6.0 marshmallow

@ocram ocram added bug and removed question labels Mar 14, 2018
@ocram
Copy link
Contributor

ocram commented Mar 14, 2018

There’s certainly one thing you could all do in order to help solve this issue for everybody:

TakahikoKawasaki/nv-websocket-client is the underlying WebSocket library that we’re using. You could create a new Android project, include that WebSocket library, and build a basic and very simple Activity that connects to your server using wss. You should specifically try versions 2.3 and 1.31 of that library. I’m afraid there’s nothing more we can do here. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants