[TIMOB-24146] iOS - HTTPS module crashes on SDK 6.0.0+
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-11-14T23:31:03.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | https 2.0.2 |
Components | iOS |
Labels | https, ios |
Reporter | Rodolfo Perottoni |
Assignee | Hans Knöchel |
Created | 2016-11-13T23:24:23.000+0000 |
Updated | 2018-08-06T17:49:12.000+0000 |
Description
I'm not being able to use the latest HTTPS module in a project with SDK 6+.
When executing the following code:
var securityManager = https.createX509CertificatePinningSecurityManager([
{
url: "https://whatever.com",
serverCertificate: "blablabla.der"
},
{
url: "https://whatever2.com",
serverCertificate: "blablabla2.der"
}
]);
I get the following error:
[ERROR] Script Error -[AppceleratorHttpsModule jsobject]: unrecognized selector sent to instance 0x7fa0bec0bef0
This is happening with wildcard certificates.
I can't provide my code because I'd be breaking a NDA.
Please attach or send at least the full error log to see which method breaks the process. Thx!
Ok, so this issue does only happen when using the 2.0.1 module on 6.0.0, it does not happen on 5.5.1.GA. Do it must be something with the changed require-behavior in 6.0.0. Assigned to [~cwilliams] as he worked on the migration, but I'll take a look at well. *EDIT*: It crashes in [this line](https://github.com/appcelerator/titanium_mobile/blob/6_0_X/iphone/Classes/KrollBridge.m#L828). *EDIT2*: The difference to other modules like ti.map is that it tries to interprete the module as a JS module ([this code-block](https://github.com/appcelerator/titanium_mobile/blob/6_0_X/iphone/Classes/KrollBridge.m#L811-L813) should return already).
Yep. I'll be using 5.5.1.GA in the meanwhile. Thanks Hans.
Ok, fixed it. The problem was that we hardcoded the module assets that are usually generated by the compiler. Probably the initial author commited his local file back in the days. I'm still not sure how it could work in Titanium 5.5.x, but the problem was that we check if the JS module based on having module assets (= JS code = NSData) or not. So it returned a false positive and crashed when the SDK tried to evaluate the JS context (
jsobject
call). PR (appcelerator.https/master): https://github.com/appcelerator-modules/appcelerator.https/pull/42 Test-Case:Also updated the Github release-page and will ping Patrick to update the version in our dashboard.
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.