I am developing an app for iOS using Titanium Appcelerator. I am struggling with securing the connections to my server. I bought a UCC certificate to protect my server (and other websites) and installed it. When I go on any browser, it displays that the connection is secured.
Now, when I try to create a connection from the app to my server, I get the following error:
The certificate for this server is invalid. You might be connecting to a server that is pretending to be DOMAIN.COM
I've tried with other secured domains, and it works fine. I am using Ti.Network.createHTTPClient to create my connections. Does anyone have any idea about that problem? Is there something I'm missing here?
I found the reason why in my case the connection was refused. The catch was that I hadn't concatenated the two cert files given by godaddy, which doesn't seem to be a problem on browser, but was breaking the chain of trust for the app. Correcting that part fixed the issue, using:
to create the full crt file.
Note: The first cert file is downloadable on Godaddy's website, but is also attached when you download your crt file.
You should use a
securityManager
to communicate with a secured website. Below is the simple example from the documentation. The certificate should be provided as a X.509 certificate file in DER binary format.Disclaimer: The
appcelerator.https
module is a paid feature!