Socket.io-client-swift: ssl with socket io and swift for iOS app not working

Created on 23 Oct 2017  路  1Comment  路  Source: socketio/socket.io-client-swift

I have set up and can successfully use my socket for a chat application on the iPhone using port :3000. However when I try to use port :443, I cannot connect.

My index.js file begins:

    var app = require('express')();
    var https = require('https');
    var fs = require('fs');

    var options = {
        key: fs.readFileSync('...path/example.com.key'),
        cert: fs.readFileSync('...path/example.com.crt'),
        ca: fs.readFileSync('...path/intermediate.crt')
    };

    var server = https.createServer(options, app);

    var io = require('socket.io')(server);

    server.listen(443, function(){
        console.log('Listening on *:443');
    });

And on the client side, my attempted connection is:

var socket: SocketIOClient = SocketIOClient(socketURL: URL(string: "https://www.example.com:443")!)

The socket connection is hanging and empty JSON returned. Wondering if I need a configuration file or something else to make this work. If I change 443 to 3000 above, everything works fine but I need to use SSL.

question

>All comments

Ports below a certain number generally require the application run as a superuser. Besides that, make sure you understand Apple's strict requirements for TLS connections.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roma86 picture roma86  路  4Comments

njawahire picture njawahire  路  4Comments

zevarito picture zevarito  路  3Comments

Yelles picture Yelles  路  5Comments

Dohab picture Dohab  路  4Comments