[TIMOB-6715] iOS: validatesSecureCertificate default value is always "false"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-12-16T14:36:10.000+0000 |
Affected Version/s | Release 1.8.0.1, Release 3.3.0, Release 3.4.0 |
Fix Version/s | Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20 |
Components | iOS |
Labels | network, qe-port |
Reporter | Stephen Tramer |
Assignee | Hieu Pham |
Created | 2011-12-15T19:19:41.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
ios.PNG | 2014-08-14T08:21:34.000+0000 | 14770 |
mFoundry needs this in 2.2. Additional question is how to deal with this flag for remote image requests in Image Views?
The solution is to explicitly set
Ti.Network.HTTPClient.validatesSecureCertificate
totrue
.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.
Fixed in master by https://github.com/appcelerator/titanium_mobile/pull/3054
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
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:
Attaching the screenshot.
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".
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
This issue is present in SDK 3.3.0 and 3.4.0 but is working as expected on 3.2.3.
The provided example code works in newer versions of the SDK, tested with 6.0.x and 6.1.0.