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 connection issue with tubesock #101

Closed
daupawar opened this issue May 24, 2016 · 22 comments
Closed

wss connection issue with tubesock #101

daupawar opened this issue May 24, 2016 · 22 comments
Labels

Comments

@daupawar
Copy link

When i was trying to connect Secure layer with wss://myurl/websocket i am getting Meteor Exception error while creating secure socket error
Same url works with meteor ios lib in ios
so i replaced tubesock code with nv-websocket-client and now its working fine

@ocram ocram added the question label May 26, 2016
@ocram
Copy link
Contributor

ocram commented May 26, 2016

Thanks for your report!

Can you share the URL? Or some other URL where this happens?

Is there any way you can print the complete stack trace and post it here?

Or are you trying to use a self-signed certificate? #100

@ocram
Copy link
Contributor

ocram commented Jul 7, 2016

It seemed this was due to Server Name Indication (SNI) as part of SSL/TLS, which may not be supported by our WebSocket library. Can someone verify?

@daupawar
Copy link
Author

daupawar commented Jul 15, 2016

SNI is not an issue, 'nv-websocket-client' works well where 'tubesock' can't

@ocram
Copy link
Contributor

ocram commented Jul 17, 2016

Yes, presumably because "nv-websocket-client" does support SNI :)

We'll offer a version of this library with "nv-websocket-client" instead of "TubeSock" in a separate branch so that everybody can test it and see if it works better.

@musriabhijit
Copy link

com.firebase.tubesock.WebSocketException: error while creating secure socket i am getting this exception while connecting my websocket so what is the solution

@daupawar
Copy link
Author

@musriabhijit please send your connection URL and code

@musriabhijit
Copy link

in the sample code i am just changing my web socket with http://ec2-50-17-2-110.compute-1.amazonaws.com:3000/ so this is my url

@ocram
Copy link
Contributor

ocram commented Sep 15, 2016

@musriabhijit Can you try changing http:// to ws:// at the beginning? And are you sure you don't need /websocket instead of / at the end? By the way, I can't connect to your site using this online tool so there might be some problem on your server.

@musriabhijit
Copy link

if i use wss it is going to exception and disconnected so what is the solution for this

@musriabhijit
Copy link

@ daupawar i am also facing the same Issue as mention by you at first When i was trying to connect Secure layer with wss://myurl/websocket i am getting Meteor Exception error while creating secure socket error
Same url works with meteor ios lib in ios
so i replaced tubesock code with nv-websocket-client and now its working fine
so how you solved the problem and if you made the library changes to the current library can you send that library

@daupawar
Copy link
Author

@musriabhijit I haven't made library, i downloaded whole code and changed build.gradle for nv-websocket. then i changed meteor.java file.

@musriabhijit
Copy link

you have changed the code in meteor.java file right can you send me that file so that i can use the same code i don't know how the meteor works in the back end to connect to meteor so i need the help from you if you send me the meteor.java file then it will be great help

@daupawar
Copy link
Author

@musriabhijit send me your mail id

@musriabhijit
Copy link

@ocram ocram added bug and removed question labels Oct 18, 2016
@ocram
Copy link
Contributor

ocram commented Oct 18, 2016

To sum up, we've found out that TubeSock, which has been the underlying WebSocket component for this library, doesn't seem to support Server Name Indication (SNI) or self-signed certificates with SSL/TLS.

Thus we decided it may be a good idea to switch to nv-websocket-client, which also proved to have more active support. Since we heard about it initially, that library has always been a promising alternative, but I wanted to watch it a little longer to see whether support for it continues.

Now, let's finally attempt the switch between these two libraries. I've started the transition in ec33436 but this is an early draft. There may be bugs that we'll have to fix. There are many new possibilities for configuration and customization that we'll be able to use. So that implementation has to be completed and perhaps improved in some existing parts.

If anybody has feedback on this implementation, especially given that some of you have already done this change in their private forks, I'd love to hear what you think.

In order to try the new implementation, it will be sufficient to replace the version v3.1.2 in your Gradle dependency with the following commit hash:

ec334366059f030c3ff73b66f154dcf5f333359c

Should you still be interested in this issue, @daupawar, @musriabhijit, @MathiasHH, @elbow, @vlasky, @isdzulqor and anybody else, your feedback will be much appreciated. Thanks!

@daupawar
Copy link
Author

@ocram that would be great. I have been using 'nv-websocket-client' in forked code from last 3 months, I tried with different urls ('wss' and 'ws') and haven't found any issue with it.

@ocram
Copy link
Contributor

ocram commented Oct 20, 2016

Oh, let's keep this open for now :)

As explained above, I have changed the WebSocket library in this project as well. So hopefully, everyone can soon use this repository instead of their private forks again.

For that to happen, I just need some feedback on the implementation. My previous comment explains how the implementation can be tested with your app.

Since some of you have created their private forks, I'd also love to hear about how your code is different from ec33436 and whether we need some more changes for everything to work correctly, including SSL/TLS with SNI and self-signed certificates.

@ocram ocram reopened this Oct 20, 2016
@ocram
Copy link
Contributor

ocram commented Jan 17, 2017

Again, the following is the dependency for those who would like to test this library with the alternative WebSocket library that may replace the existing one:

compile 'com.github.delight-im:Android-DDP:ec334366059f030c3ff73b66f154dcf5f333359c'

@shaiamir
Copy link

ws and wss works for me. Thanks!

@ocram
Copy link
Contributor

ocram commented Feb 18, 2017

@shaiamir Thanks! This is now in the main branch and in the latest release:

c4d7226

@ocram ocram closed this as completed Feb 18, 2017
@deadjdona
Copy link

Good day.

Can you update nv-websocket-client to latest version, please?

@najeebullahshah
Copy link

I am using a wss one with the following dependency:

compile 'com.github.delight-im:Android-DDP:ec334366059f030c3ff73b66f154dcf5f333359c'

and getting the following exception:

com.neovisionaries.ws.client.WebSocketException: Failed to get the input stream of the raw socket: Connection closed by peer

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

6 participants