Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

xhr bug with iPad

…Using mobilesdk bits that I got from the repository and built manually this afternoon…

The good news is you guys appeared to have fixed the issue with the WebView being unresponsive to user input on the iPad. The bad news is something seems a little funky with HTTPClient and basic authentication.

I have code that works fine in the iPhone Simulator, but when I create an iPad project and run it, I get a strange error.

Basically I am using the HTTPClient object and setRequestHeader to do auth like so:


    xhr.open("GET", url);
    // Credentials (basic auth)...
    xhr.setRequestHeader('Authorization','Basic ' + Ti.Utils.base64encode(prefs.user+":"+ prefs.pwd));

    xhr.send();

What happens is my onError gets called back with the following:

ERROR Error Domain=ASIHTTPRequestErrorDomain Code=1 UserInfo=0x6320ee0 "A connection failure occurred: SSL problem (possibily a bad/expired/self-signed certificate)"

Note, the end point I am calling is http NOT https any ideas?

Shaun

— asked March 31st 2010 by Shaun Sullivan
  • httpclient
  • ipad
0 Comments

1 Answer

  • Test setting "Titanium.Network.HTTPClient.validatesSecureCertificate" property to false.

    You can find further info here: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Network.HTTPClient-object

    — answered January 30th 2012 by Eduardo Gomez
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.