Swift Realm - ATS failed system trust - ios

I am upgrading a project from Swift 3 to Swift 5. The project uses Realm for an internal database, but every time I launch the app in the simulator I get the following errors in the console:
ATS failed system trust
Connection 2: system TLS Trust evaluation failed(-9802)
I'm pretty sure this is a Realm issue as the app doesn't try to make any other external connections. When running on a older version of Xcode(8), it all works fine without errors. I'm currently testing on Xcode 10.3 and 11 (beta) and using Realm 3.17.3.
Any help would be appreciated.
This error is only produced in the simulator. When running on an actual device no errors get logged

Related

iOS 11 Beta - NSURLErrorDomain - code: 18446744073709550617

When running my app on iOS 11 beta 5 built with Xcode 9 I see this error from several of our network calls.
"NSURLError * domain: #“NSURLErrorDomain” - code:
18446744073709550617"
I've never come across this error before and we haven't made any change to the app currently. For networking, we are using AFNetworking v2.5
So it turns out it was ssl related. Eventually what I did was add an exception for the domain in info.plist and was able to get a reasonable error that said there was an ssl issue. Investigating that showed our cert was weakly signed. We replaced it which resolved the issue.

Different behaviour NSAllowsArbitraryLoadsInWebContent IOS 10.1 and 10.2

When loading a certain url in UIWebView in IOS 10.1 it is failing on
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made"
However the same webview loads fine in iOS 10.2
I can load the url in both 10.1 and 10.2 if I use NSAllowsArbitraryLoads = YES but only in 10.2 with NSAllowsArbitraryLoadsInWebContent = YES
I tested the URL with nscurl --ats-diagnostics and it passes all tests
I think that the issue may have something to do with an ip location validation within the webpage.
Are the differences between 10.1 and 10.2 in the handling of App Transport Security Settings? Are these documented?
---- Edit -----
I managed to resolve my issue by looking at the error in didFailLoadWithError. This told me exactly what the url was that was causing the failure. I added this url to my Exception Domains with NSExceptionRequiresForwardSecrecy=NO (determined using the ats diagnostics)
This fixed my problem but I still would like to understand the differences in the two versions 10.1 & 10.2.
Yes, earlier versions of iOS 10 did still enforce the forward secrecy requirement of app transport security in web views even with the NSAllowsArbitraryLoadsInWebContent key. That was a bug, that was fixed by Apple. The problem is that earlier versions of iOS shipped with the bug so you must be able to handle it, which isn't always possible if you don't know all the possible URLs that your Web you could navigate to. This may be part of the reason that Apple has extended their deadline for enabling app transport security and all apps submitted to the App Store.

iOS app cannot connect to MobileFirst server

i created an hybrid application that should connect to the MFP and consume data.
When i try to connect to the Desktop Browser Application everything is fine and the app works. Same behaviour when i try the Mobile Web Application. BUT when i try to connect with the mobile native iOS application i could not connect and receive the following error (in the console):
2015-11-12 17:22:15.031 APPXYZ[6072:3089110] [FATAL] [NONE] Uncaught Exception: TypeError: WLJSX.Ajax.WLRequest.setConnected is not a function. (In 'WLJSX.Ajax.WLRequest.setConnected(false)', 'WLJSX.Ajax.WLRequest.setConnected' is undefined) at (compiled_code):3871
My specs:
MFP version 7.1.0.00.20151107-1653
Xcode 7.1.1
iOS deploy target 8.0
Transport security protocol is deactivated (Allow Arbitrary Loads -> YES)
I cannot confirm this claim.
Using the following, I create a blank new Hybrid app with the iPhone environment, that calls the WL.Client.connect method in wlCommonInit() and displays an alert with "success" or "failure" accordingly. I got "success". No errors in the Xcode Console.
Xcode 7.1.1
IBM MobileFirst Platform Studio 7.1.0.00-20151107-1647
If you are doing something different in your project, do let us know...
The solution of my problem was that i change the init calling sequence of my app. I called the wl specific functions to early. After changing the sequence my app runs perfectly.....
thx 4 help :)

Livecode revdberr invalid database connection

The simulator and the actual iPhone are giving me this error when trying to make the connection to the database.
revdberr invalid database type
My database is the mysql service that comes with the livecode hosting.
I can run the app fine from my Mac and from my PC, but simulator and phone gives the error.
I have checked the Mysql external under standalone application settings.
The line of code I am using is
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
My LC version is 7.1.0 Indy and Xcode 6.4
Another thing to note is that it gives me the error while disconnected from the internet also, so something is happening before even trying to connect.
Going crazy here :)

IBM Worklight 6.1 - Adapter invocation failing in iOS 5 after upgrading to v6.1

We have developed a Worklight-based Hybrid application with Native pages as well. Our start page is a native page from which we are invoking an adapter.
After upgrading to Worklight 6.1, this adapter invocation is now always failing in iOS 5, however continues to function correctly in iOS 6 and iOS 7.
When the adapter invocation fails, it returns raw HTML as the response: Adapter Failure Response.
In Xcode Console this is the error we see:
[ERROR] Worklight: -[WLRequest requestFailed:]:338::Status code='404'
error='(null)' [ERROR] Worklight: -[WLClient
onInvokeProcedureFailure:userInfo:]:696::response string=HTML
returning from adapter
The same application in Worklight 6.0.0.x works OK in iOS 5, 6 and 7.
This sample application can be used to see the error.
From tests made, it appears that the adapter invocation fails only in iOS 5 because the request sent contains double-slashes whereas in iOS 6 and 7 it contains one slash.
This can be verified in Wireshark:
This is a defect
There is not applicable workaround
Once the defect is fixed, it will be available via IBM Fix Central, as well as in the PMR that your customer needs to open anyway to get this fixed.
Check your wlclient.properties file, especially wlServerContext property. Looks like you're trying to connect to invalid URL.

Resources