Sockets using SSL/TLS
Hi,
I'm trying to initiate a secure socket connection using the following:
var ISOS_HEART_VAR_DEFAULT_API_HOST = 'tls://customer.heartinternet.co.uk';
var ISOS_HEART_VAR_DEFAULT_API_PORT = 674;
var socket = Titanium.Network.createTCPSocket({
hostName:ISOS_HEART_VAR_DEFAULT_API_HOST,
port:ISOS_HEART_VAR_DEFAULT_API_PORT,
mode:Titanium.Network.READ_MODE
});
When I run the app and click the button that runs 'socket.connect()' nothing happens, except that about 30 seconds later the app crashes (this is using the simulator and not on a live phone). After the socket.connect() runs other trivial buttons on the window are still responsive but no longer execute the code behind them, even if that code is as simple as a message box.
There are no debug messages produced and indeed socket.connect() is wrapped in a try…catch. The app appears to exit 'gracefully' but obviously doesn't.
If anyone has any ideas about why this might be happening I'd be really grateful to hear from you, and also let me know if there's any information I can provide to make it easier to diagnose.
Cheers
1 Answer
-
Please, read my answer :)