Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24146] iOS - HTTPS module crashes on SDK 6.0.0+

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-11-14T23:31:03.000+0000
Affected Version/sRelease 6.0.0
Fix Version/shttps 2.0.2
ComponentsiOS
Labelshttps, ios
ReporterRodolfo Perottoni
AssigneeHans Knöchel
Created2016-11-13T23:24:23.000+0000
Updated2018-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.

Comments

  1. Hans Knöchel 2016-11-14

    Please attach or send at least the full error log to see which method breaks the process. Thx!
  2. Hans Knöchel 2016-11-14

    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).
  3. Rodolfo Perottoni 2016-11-14

    Yep. I'll be using 5.5.1.GA in the meanwhile. Thanks Hans.
  4. Hans Knöchel 2016-11-14

    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:
       var https = require('appcelerator.https'); // This already crashed with the above error
       
    Also updated the Github release-page and will ping Patrick to update the version in our dashboard.
  5. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source