NSURLErrorDomain code 1200 and 1004 in a cordova hybrid app

379 views Asked by At

I have an old hybrid mobile app that uses the below:

  1. Cordova iOS 5.1.1
  2. advanced-http plugin version 1.5.5
  3. Xcode 11.6

Other plugins inculded are: "cordova-plugin-device", "cordova-plugin-device-orientation, "cordova-plugin-file", "cordova-plugin-file-transfer", "cordova-plugin-inappbrowser", "cordova-plugin-geolocation", "cordova-plugin-network-information", "cordova-plugin-globalization", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "com-badrit-contactpicker", "com.xxx.keychainencryption", "cordova-plugin-jailbreak-detection", "cordova-plugin-advanced-http", "cordova-plugin-privacyscreen", "cordova.plugins.diagnostic"

I have a cache-manifest file that is fetched from the server (GET method) and lists around 250+ files that include html, js, css, images and fonts files. The app then loops through these 250+ files and downloads (advance-http downloadFile method) these files from the server.

The app has SSL pinning enabled.

ISSUE: While making the downloadFile request some request fails and throws errors like:

[-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x60000283d2f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <8D9836BB-337A-4DE2-BF2C-E91B263C84CB>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <8D9836BB-337A-4DE2-BF2C-E91B263C84CB>.<1>" ), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=https://xxxx.xxx.com/MobileApp/themes/images/icon_home_x2.png, NSErrorFailingURLKey=https://xxxx.xxx.com/MobileApp/themes/images/icon_home_x2.png, _kCFStreamErrorDomainKey=1}

When I connect to another server using VPN same app but a different SSL cert, I get

2020-12-21 11:02:07.670919+0530 ZZZ[67979:2230102] Task <75B8FFDB-C4D7-428D-8BAD-6B641385F7FF>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://zzz.zzzzzz.com/MobileBanking/html/services/moneyxxxx.html, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <75B8FFDB-C4D7-428D-8BAD-6B641385F7FF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <75B8FFDB-C4D7-428D-8BAD-6B641385F7FF>.<1>" ), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://zzz.zzzzzz.com/MobileBanking/html/services/moneyxxxx.html, NSUnderlyingError=0x600000b32b20 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9824, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9824}}, _kCFStreamErrorCodeKey=-9824}

I could not find any docs that explain these errors or any solutions regarding them.

0

There are 0 answers