Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6715] iOS: validatesSecureCertificate default value is always "false"

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-12-16T14:36:10.000+0000
Affected Version/sRelease 1.8.0.1, Release 3.3.0, Release 3.4.0
Fix Version/sRelease 3.0.0, Sprint 2012-20 API, 2012 Sprint 20
ComponentsiOS
Labelsnetwork, qe-port
ReporterStephen Tramer
AssigneeHieu Pham
Created2011-12-15T19:19:41.000+0000
Updated2017-03-31T22:36:56.000+0000

Description

Currently on iOS, the Ti.Network.HTTPClient.validatesSecureCertificate property is always false by default, even in production. From the documentation description (which is the correct behavior): bq. False when running in the simulator or on device in testing mode, and true if built for release in distribution mode. Testing Steps: 1. Run this code
var xhr = Ti.Network.createHTTPClient();
Ti.API.info("validatesSecureCertificate: " + xhr.validatesSecureCertificate);

Attachments

FileDateSize
ios.PNG2014-08-14T08:21:34.000+000014770

Comments

  1. Carl Orthlieb 2012-06-18

    mFoundry needs this in 2.2. Additional question is how to deal with this flag for remote image requests in Image Views?
  2. Stephen Tramer 2012-06-18

    The solution is to explicitly set Ti.Network.HTTPClient.validatesSecureCertificate to true.
  3. Carl Orthlieb 2012-06-18

    Should be set to true if built for release in distribution mode, correct? Or are you suggesting a workaround? The customer is aware of the workaround but wants iOS to follow the spec.
  4. Vishal Duggal 2012-10-02

    Fixed in master by https://github.com/appcelerator/titanium_mobile/pull/3054
  5. Olga Romero 2013-01-16

    Closing as fixed. Tested and verified with: Titanium Studio, build: 3.0.1.201212181159 Titanium SDK, build: 3.0.0.GA iOS simulator 6.0 Device: iPad mini iOS 6.0.2
  6. Priya Agarwal 2014-08-14

    Reopening the issue. Getting validateSecureCertificate value as "undefined". Verified with: Appcelerator Studio:3.3.0.201407111535 Sdk:3.3.0.GA alloy:1.4.1 titanium:3.3.0 titanium-code-processor:1.1.1 acs:1.0.15 npm:1.3.2 OS:Maverick(10.9.4) Device: iPhone5(v7.1.2) xcode: Xcode6Beta5 Code used:
       var xhr = Ti.Network.createHTTPClient();
       Ti.API.info("validatesSecureCertificate: " + xhr.validatesSecureCertificate);
       
       var win=Ti.UI.createWindow({});
       var label=Ti.UI.createLabel({color:"red"});
       label.text="validatesSecureCertificate: " + xhr.validatesSecureCertificate;
       
       win.add(label);
       win.open();
       
    Attaching the screenshot.
  7. Dhirendra Jha 2014-08-14

    Tried the same code with below environment (SDK 3.2.3.GA) - Appcelerator Studio:3.3.0.201407111535 Sdk:3.2.3.GA alloy:1.4.1 titanium:3.3.0 titanium-code-processor:1.1.1 acs:1.0.15 npm:1.3.2 OS:Maverick(10.9.4) Device: iPhone5(v7.1.2) xcode: Xcode5.1.1 Result - Getting validateSecureCertificate value as expected "false".
  8. Marco Cota 2014-09-18

    We have received reports from customer about this issue, during a call with them we notice that validatesSecureCertificate returns 'undefined' if the value is not manually set, this is causing problems with the development environment as they use self-signed certificates and if the value is not 'false' they receive errors from their server.

    Workaround

       var xhr = Ti.Network.createHTTPClient();
       xhr.validatesSecureCertificate = false;
       Ti.API.info("validatesSecureCertificate: " + xhr.validatesSecureCertificate);
       
    This issue is present in SDK 3.3.0 and 3.4.0 but is working as expected on 3.2.3.
  9. Hans Knöchel 2016-12-16

    The provided example code works in newer versions of the SDK, tested with 6.0.x and 6.1.0.

JSON Source