Wss Connection Error in Cordova


#1

I have a problem when Cordova app connect to Chat Server developed by nodeJS language with secured web socket.
The Chat Server is configured to SSL as letsencrypt certification files,which is generates by letsencrypt include stand-alone option. (cert.pem, fullchain.pem, chain.pem, privkey.pem)
I configured SSL on several Servers. Apache-tomcat, WebRTCSip, Chat Server and File Server.
android phones work very well. but iPhone is not woking.
iPhone logs say that SSL handshake failed.
All of iOS, iPhone5S(iOS9.2) , iPhone6S(iOS9.2) and iPad Air(iOS9.1.2) have same problem.
I think that devices has iOS operation system can’t connect wss to Server is configured by letsecrypt certification files.
What can I do to resolve this problem?

This is error logs at iOS

Feb 24 10:54:56 lwjunui-iPad OneChance[251] : SecTrustEvaluate [leaf AnchorTrusted]
Feb 24 10:54:56 lwjunui-iPad OneChance[251] : CFNetwork SSLHandshake failed (-9807)

This is Chat Server configration

[config.js]

/** SSL Config File Path **/
exports.PrivateKeyPath = ‘/etc/letsencrypt/archive/magpie.m2soft.co.kr/privkey1.pem’;
exports.CertificatePath = ‘/etc/letsencrypt/archive/magpie.m2soft.co.kr/cert1.pem’;
exports.RootCAPath = ‘/etc/letsencrypt/archive/magpie.m2soft.co.kr/fullchain1.pem’;

[chatServer.js]

var https = require(‘https’);
var credentials = { key : privateKey, cert : certificate, ca: rootCA };
var httpsServer = https.createServer(credentials, function(request, response) {
});


#2

You don’t use it in your server. Maybe the chat webpage use Let’s Encrypt, so most of the time the browser saw the intermediate certificate before the wss connection and keep it in cache, which hide the misconfiguration.

You should test your wss connection with ssllabs.