Titanium Community Questions & Answer Archive

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

HTTPClient validatesSecureCertificate not working on Android 2.1?

When running on the device in release mode, the validatesSecureCertificate seems to be ignored. I am setting the value to false like so:

httpClient.validatesSecureCertificate = false;

However when building for release it seems to be ignored and I always get the error message "Not trusted server certificate." I have tried this on SDK 1.6.2 and 1.7.0 beta SDK.

I don't have control over the server cert, so that is not an option for me unfortunately.

Thanks

— asked May 11th 2011 by Jake Jake
  • httpclient
  • validatessecurecertificate
0 Comments

1 Answer

  • There is a bug with the SDK, I saw it in a ticket that is causing this issue (I forget which ticket).

    One workaround that has worked for some is to simply define the validatesSecureCertificate value when you create the httpClient rather than tacking it on later as you have been doing.

            var xhr = Ti.Network.createHTTPClient({
                validatesSecureCertificate: false,
                timeout: 120000
            });
    
    — answered May 13th 2011 by Mike Robinson
    permalink
    1 Comment
    • Hmm didn't seem to make any difference. It's odd - seems inconsistent depending on the phone or perhaps carrier.

      — commented May 16th 2011 by Jake Jake
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.