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:// ssl support #23

Open
sf-jin-ku opened this issue Feb 6, 2016 · 15 comments
Open

wss:// ssl support #23

sf-jin-ku opened this issue Feb 6, 2016 · 15 comments

Comments

@sf-jin-ku
Copy link

Hi @omorandi,

We have an issue when we use "wss://" with raw createWS() in iOS.
Websocket doesn't connect to server.
If we use "ws://", then everything looks fine.
Are there any known issue with it?

Thanks!

@omorandi
Copy link
Owner

omorandi commented Feb 8, 2016

I've tested this a bit and indeed it looks like using wss doesn't work. Actually the SocketRocket library should support secure websockets transparently. I'll try digging more into the issue.

@iamyellow
Copy link
Collaborator

the point is, is the cert self-signed -i mean, you did not purchase it-? if so, i guess it may be the cause and i think the cause it's because the OS, security reasons.

On 08 Feb 2016, at 09:52, Olivier Morandi [email protected] wrote:

I've tested this a bit and indeed it looks like using wss doesn't work. Actually the SocketRocket library should support secure websockets transparently. I'll try digging more into the issue.


Reply to this email directly or view it on GitHub.

@sf-jin-ku
Copy link
Author

@iamyellow Hi! We're using purchased one not self-signed one.
@omorandi Thanks for digging this issue. Odd thing is that we also use SocketRocket in native iOS platform as well and it doesn't have any issues with SSL. Tiws + SocketRocket in Titanium doesn't work though. This issue could be a major blocker for a lot of people who love Tiws :(

@iamyellow
Copy link
Collaborator

@sf-jin-ku sounds silly, but... could you try if it works changing the schema? https instead of wss
also would be useful if they would know which version of SR are you using, and obviously some code :)

@jvega2k
Copy link

jvega2k commented Mar 20, 2016

hi @iamyellow @omorandi ok here some code:

Server site with nodejs:

var io = require('socket.io')();
var ex = require('express')();

var http = require('http');
var https = require('https');

var fs = require('fs');
var options = {
key: fs.readFileSync('cert.key', 'utf8'),
cert: fs.readFileSync('cert.crt', 'utf8'),
ca: fs.readFileSync('certca.crt', 'utf8')
};

var app = http.createServer(ex);
var apps = https.createServer(options,ex);

io.attach(app);
io.attach(apps);

app.listen(8000);
apps.listen(443);

Client Tiws site:

socket = io.connect("https://host.url",{
'transports' : [ 'websocket' ],
'reconnect' : true,
'reconnect delay' : 100,
'reconnect limit' : 5000, secure:true,port:443,
query:'i='+Titanium.App.Properties.getString('SomeVar')

});

Same Problem not connecting to ssl port... and this is ssl cert i have buy on a certify ssl company in the world.

Thanks like this module... i need to implement this secure connections.
Thanks for your help

@sf-jin-ku
Copy link
Author

@omorandi any luck with this issue? we're still struggling with it.
@iamyellow yeah. we tried "https" but still same.

We create a ws object like this.

ws = require('net.iamyellow.tiws').createWS();
ws.open("wss://yyy.xxx.co:9010");

"ws://" works perfect but "wss://" doesn't work.
The same web socket server ( we use autobahn python server ) runs well with native iOS SRWebSocket lib in another project without any problem.

@jvega2k
Copy link

jvega2k commented Mar 29, 2016

any luck with this issue?

@iamyellow
Copy link
Collaborator

Hi,
I know it might be something strange, but still so interesting, you have to see it here http://nkuxocretha.wellnesscoachnyc.co/lnhcskx

Good wishes, jordi domenech

@chmiiller
Copy link

Hi everyone,
any updates on this?

@omorandi
Copy link
Owner

omorandi commented Jul 7, 2016

I've updated the iOS module to SocketRocket v0.4.2. It seems to work fine in my tests, please check it out.

@chmiiller
Copy link

chmiiller commented Jul 7, 2016

yep, seems to work properly now! Thank you so much =)
You can close this issue I guess

@enbifa
Copy link

enbifa commented Jul 10, 2016

Hi guys,

I continue to have the problem with a .NET standard websocket server (windows server 2012)...
I probably do not pass a few parameters, my call is

APP.WS.open(myurl);

and the response is

[DEBUG] SecTrustEvaluate [leaf SSLHostname]
[DEBUG] CFNetwork SSLHandshake failed (-9807)
[INFO] "Error Domain=NSOSStatusErrorDomain Code=-9807 "(null)""

any suggestions?

@reinisyed
Copy link

Hi everyone,

In my android wss it did not work .
have people who have the same problem ?

use android OS 5.1.3
use tls v1.2
titanium.platform=C:\ProgramData\Titanium\mobilesdk\win32\5.2.2.GA\android
android.platform=C:\android-sdk-win\platforms\android-23
google.apis=C:\android-sdk-win\add-ons\addon-google_apis-google-23
android.ndk=C:\android-ndk-r11c

@AndreaVitale
Copy link

AndreaVitale commented Feb 7, 2017

Everything is working for me, both iOS and Android. SDK 5.5.1. Thanks!

@eemi2010
Copy link

eemi2010 commented Sep 9, 2017

wss support not working on Android and SDK 6+
My bad. It s working

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

No branches or pull requests

9 participants