Description:
Using the 2.1.1 Library for iOS and in some times (Not all the time) when doing a request to the Backend the SSL-Pinning fails saying that the https.createX509CertificatePinningSecurityManager is not a function (Pic Attached) even when using the same function
Code:
if (OS_IOS || OS_ANDROID) {
var https = require('appcelerator.https');
var securityManager = https.createX509CertificatePinningSecurityManager(
[{
url: Alloy.Globals.baseUrl,
serverCertificate: Alloy.Globals.serverCertificate
}]);
}
Additional information
Request works well when on SDK 6.3.0 but in SDK 7.0.1 there is an error. We have tried to recreate this on our end but unable to get the same error. So the customer has attached a video of the error occurring.
It looks like the https instance is required when the backend-call is done? I could think of an issue where the scope gets lost when not require-ing the module in the top of the controller but inside a method. I don't think we will be able to reproduce this with the above code, so we would definitely need a full reproducible case or otherwise advice to check how the module is required. Also, I cannot see how the SDK version could influence this behavior but we will check related code-changes between those versions.