App.js
(function() { var myView = Ti.UI.createView(); var win = Ti.UI.createWindow(); var label = Ti.UI.createLabel(); myView.add(label); win.add(myView); win.open(); var xhr = Ti.Network.createHTTPClient({ onload : function() { Ti.API.info("Successfully received data from HTTPS"); label.text = this.responseText; }, onerror : function() { Ti.API.info("There was an error receiving data from HTTPS."); } }); xhr.open("GET", "https://www.muthwill-it.se/other/titanium/1.txt"); xhr.send(); })();Gives me:
[INFO] : There was an error receiving data from HTTPS.
I've been searching for ages to an answer to this question that I'm sure many people have. Is there a simple guide to enable HTTPS in an HTTPClient? There's nothing wrong with the url either, here's the link: Muthwll-IT JSON Example - Using HTTPS
I've seen somewhere that you need to download and validate the certificate, but how on Earth do you do that?
Thank you very much for your help!