{ "id": "85695", "key": "TIMOB-7470", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2012-05-31T13:35:46.000+0000", "created": "2012-01-30T10:54:40.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "15839", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "63585", "key": "TIMOB-2953", "fields": { "summary": "iOS Feature Request: ImageView validatesSecureCertificate property", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Trivial", "id": "5" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:09:28.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. PROBLEM DESCRIPTION\r\nCustomer addressed an XHR issue we had using SSL on iOS5 against our test server. iOS5 uses TLS v1.2 by default and our server fails to negotiate v1.2. They used this:\r\n\r\nhttp://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Network.HTTPClient.tlsVersion-property.html\r\n\r\nand worked fine. The only issue is that they are getting images from the secure server with iOS5, will fail. \r\n\r\nh4. EXPECTED BEHAVIOR\r\nThe TLS configuration impacting the imageview url \r\n\r\nh4. ACTUAL BEHAVIOR\r\nThe image is failing to download in iOS5\r\n\r\nh4. TEST CASE\r\n\r\n\r\nh4. TEAMWORK DISCUSSION\r\nhttps://appcelerator.teamworkpm.net/tasks/524931\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: Set TLS version for imageview", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": "Titanium SDK version: 1.9 CI \r\nPlatform & version: iOS 5.0\r\nDevice Details: iOS simulator (ipad) \r\nHost Operating System: OSX Lion\r\nTitanium Studio version: 1.0.7", "comment": { "comments": [ { "id": "182108", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Image View gets their images through the image loader, which is a low level aspect. Image Views don't load images directly, so this would not be a property on each individual image view. There's a few options here.\r\n\r\n1) Have global settings that can be set to lower the TLS version as a 'compatibility mode' for all images fetched.\r\n\r\n2) allow an HTTPClient be bound to an imageView as an image source. Issues here involve that clients can only be opened once, and might be expensive.\r\n\r\nEither way, we'll have to look into this. I'm hesitant for short-term fix or creeping featurism that may prove expensive to maintain later on.\r\n", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T14:39:05.000+0000", "updated": "2012-02-06T14:39:05.000+0000" }, { "id": "182110", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Believe it or not, the best solution might actually to be to use existing infrastructure to pull the image down from the remote source via an XHR client, and upon completion set it as the imageview's image (via a downloaded file - this has the convenient side-effect of even behaving like our internal image caching). Most developers will not be using TLS versioning to pull images from an HTTPS source so we should definitely be wary of bloat.\r\n\r\nSetting a TLS version globally runs the risk of errors or insecure communication when contacting multiple servers over HTTPS.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-06T14:49:05.000+0000", "updated": "2012-02-06T14:49:05.000+0000" }, { "id": "182233", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The following is the appropriate way to load images from secure resources. In general, when accessing resources over SSL, an HTTPClient is the \"most appropriate\" way to interact with the server, due to certificate validation and TLS versioning settings. In the future there may also be many more options which affect interoperability with SSL.\r\n\r\nAs a bonus, it also gives finer-grained control over the \"crossfade\" animation we provide internally when loading a remote resource, as well as better cache control for downloaded images.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'white'\r\n});\r\n\r\nfunction loadRemoteImage(local, remote, imageProps) {\r\n\tvar file = Ti.Filesystem.getFile(Ti.Filesystem.applicationSupportDirectory, local);\r\n\tvar imageView = Ti.UI.createImageView(imageProps);\r\n\t\r\n\tif (!file.exists()) {\r\n\t\tvar imageLoader = Ti.Network.createHTTPClient();\r\n\t\timageLoader.open('GET', remote);\r\n\t\timageLoader.file = file;\r\n\t\timageLoader.onload = function(e) {\r\n\t\t\t// Prep the image for crossfade\r\n\t\t\timageView.opacity = 0;\r\n\t\t\timageView.image = file; // Using imageLoader.file gives a path and there's some internal issues with path resolution\r\n\t\t\t\r\n\t\t\t// Manually crossfade the image\r\n\t\t\timageView.animate({\r\n\t\t\t\tduration:500,\r\n\t\t\t\topacity:1\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// Clean up the XHR\r\n\t\t\timageLoader = null; // Clean up the XHR loader; do NOT use 'this'\r\n\t\t};\r\n\t\t// Change your TLS and certificate validation settings here\r\n\t\t// imageLoader.validatesSecureCertificate = true;\r\n\t\t// imageLoader.tlsVersion = Ti.Network.TLS_VERSION_XXX;\r\n\t\r\n\t\timageView.image = \"default\" // The image: property needs to be set to a junk value so the \"default\" image displays.\r\n\t\timageLoader.send();\r\n\t}\r\n\telse {\r\n\t\timageView.image = file.nativePath;\r\n\t}\r\n\t\r\n\treturn imageView;\r\n}\r\n\r\nvar imageView = null;\r\nif (1) { // Change to see Titanium loader behavior\r\n\timageView = loadRemoteImage('kitty.jpg', 'http://placekitten.com/200/300', {\r\n\t\twidth:\"auto\",\r\n\t\theight:\"auto\"\r\n\t});\r\n}\r\nelse {\r\n\timageView = Ti.UI.createImageView({\r\n\t\twidth:\"auto\",\r\n\t\theight:\"auto\",\r\n\t\timage:\"http://placekitten.com/200/300\"\r\n\t});\r\n}\r\n\r\nwin.add(imageView);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-07T11:01:59.000+0000", "updated": "2012-02-07T11:01:59.000+0000" }, { "id": "182318", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Provided an example of an appropriate way to use HTTP and SSL to interact with remote resources.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-07T17:09:09.000+0000", "updated": "2012-02-07T17:09:09.000+0000" }, { "id": "182424", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The one catch to the sample code is that in a large table view, you'll end up loading images long before they come onscreen, leading to a sudden rush and starving the ones actually onscreen. A more advanced solution would be to do the HTTP client creation and open on image load (IE, when the placeholder image loads) which would have the lazyloading that is optimal.\r\n\r\nEither way, it's possible that the best solution is not a modification to low level code, but a small JS library snippet that uses what's already there to provide results. It'd be portable, general purpose, and best yet return power to the developer to be able to tweak and tailor the code instead of waiting for a long term low level implementation. Isn't part of the reason for Titanium is that Javascript is powerful enough on its own, and flexible enough to provide solutions?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-08T13:57:05.000+0000", "updated": "2012-02-08T13:57:05.000+0000" }, { "id": "196757", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sorry, but we're still not fixing this! See the incredibly detailed workarounds and discussion on this ticket for why.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-31T13:35:46.000+0000", "updated": "2012-05-31T13:35:46.000+0000" }, { "id": "410924", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue will not fix.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:09:28.000+0000", "updated": "2017-03-09T23:09:28.000+0000" } ], "maxResults": 18, "total": 18, "startAt": 0 } } }