{ "id": "63433", "key": "TIMOB-2801", "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": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13277", "name": "Sprint 2012-08", "archived": true, "released": true, "releaseDate": "2012-04-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-11T19:28:56.000+0000", "created": "2011-04-15T03:29:54.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "SupportTeam", "api", "rplist" ], "versions": [ { "id": "11231", "name": "Release 1.5.1", "archived": true, "released": true, "releaseDate": "2011-01-24" }, { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-04-30T21:48:19.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": "{html}

Problem

\r\n

The HTTPClient errors intermittently (around half the time) when\r\nmaking an HTTPS request. The following error message is sent:

\r\n
\r\nError Domain=ASIHTTPRequestErrorDomain Code=1 \"A connection failure occurred\" UserInfo=0xb236b70 {NSUnderlyingError=0xb234cf0 \"The operation couldn’t be completed. Connection reset by peer\", NSLocalizedDescription=A connection failure occurred}\r\n
\r\n

Tested On

\r\n

All platforms tested with clean builds from both Titanium Mobile\r\n1.5.1 and 1.6.0 (pulled January 8th, 2011).
\r\nBROKEN on iPhone Simulator 4.2
\r\nBROKEN on iPod Touch 4.2
\r\nWORKS on Android Simulator 2.2
\r\nWORKS in browser (hitting the URL)\r\n

\r\n

Sample Code

\r\n
\r\nvar win = Titanium.UI.createWindow({ backgroudColor: '#333' });\r\nvar statusLabel = Titanium.UI.createTextArea({\r\n    top: 10, right: 10, left: 10, bottom: 45\r\n});\r\nwin.add(statusLabel);\r\n\r\nfunction runRequest() {\r\n    var xhr = Titanium.Network.createHTTPClient();\r\n    xhr.onload = function () {\r\n        statusLabel.value = this.responseText;\r\n        //Ti.API.info(this.responseText);\r\n    };\r\n    xhr.onerror = function (e) {\r\n        statusLabel.value = e.error;\r\n        Ti.API.error(e.error);\r\n    };\r\n    statusLabel.value = 'Waiting for response...';\r\n    xhr.open('GET', 'https://acomsx1.cos.agilent.com/QueryOpenNotificationsCount');\r\n    xhr.send();\r\n}\r\n\r\nvar refresh = Ti.UI.createButton({\r\n    title: 'Refresh',\r\n    bottom: 10, left: 10, right: 10, height: 25\r\n});\r\nrefresh.addEventListener('click', runRequest);\r\nwin.add(refresh);\r\n\r\nwin.open();\r\n\r\nrunRequest();\r\n
\r\n

Associated Helpdesk Ticket

\r\n

http://developer.appcelerator.com/helpdesk/view/64561

{html}", "attachment": [], "flagged": false, "summary": "iOS: HTTPClient intermittently errors on HTTPS requests", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "BROKEN on iPhone Simulator 4.2; BROKEN on iPod Touch 4.2; WORKS on Android Emulator 2.2;WORKS in browser (hitting the URL)", "comment": { "comments": [ { "id": "190489", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It could be a iOS 5+ issue as explained at https://developer.apple.com/library/ios/#technotes/tn2287/_index.html#//apple_ref/doc/uid/DTS40011309\r\nCould you try specify TLS version as suggested at http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Network.HTTPClient.tlsVersion-property.html\r\n{code}\r\nxhr.tlsVersion = Titanium.Network.TLS_VERSION_1_0;\r\n{code}", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-10T14:51:05.000+0000", "updated": "2012-04-10T14:51:05.000+0000" }, { "id": "190492", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "I have communicated this to the customer. I will let you know once he replies back.\r\n\r\n", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-10T15:14:26.000+0000", "updated": "2012-04-10T15:14:26.000+0000" }, { "id": "190500", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Confirmed with the customer that this issue is fixed.", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-04-10T15:33:50.000+0000", "updated": "2012-04-10T15:33:50.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }