ArcGIS for iOS (100.x): NSURLSession/NSURLConnection HTTP load failed

2591
14
01-15-2018 06:02 AM
NathanJoraanstad
New Contributor

We are currently investigating updating from the iOS native ArcGIS library (version 10.2.x) to the Xamarin .NET Runtime (version 100.x) to share code between iOS and Android. In doing so, we'll need to continue using our mapping proxy server to create a ServiceFeatureTable. Everything is working as it should on Android, but when using that same code on iOS, we are receiving the following error:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

With the iOS native library, we get around this issue by adding our proxy server to the "ags_trustedHosts" array of NSURLConnectionHowever, there does not seem to be an equivalent in the Xamarin .NET Runtime (Esri.ArcGISRuntime.Xamarin.iOS, version 100.2.0).

 

Am I missing something here? Is there a way to use mapping proxies on iOS with the ArcGIS .NET Runtime? If this is in the works but is not available yet, is there an estimated release date for the version that will include this?

 

Thanks!

0 Kudos
14 Replies
dotMorten_esri
Esri Notable Contributor

Installing the self-signed certificate on your device doesn't work either?

0 Kudos
NathanJoraanstad
New Contributor

I have not tried that, because I would have to bug our server guys who have been very busy. I'm assuming it would work, but that workflow would not be conducive for our app (since it's on the public App Store).

Is there a reason why the trustedHosts property cannot be added in the .NET Runtime? Having that work like it does in the ArcGIS iOS SDK would solve our problem.

0 Kudos
dotMorten_esri
Esri Notable Contributor

> but that workflow would not be conducive for our app (since it's on the public App Store).

The property in the iOS SDK was added for making development/testing easier. It was not meant for use in production. If you are shipping these services to production, you should make sure those servers have proper SSL certificates. If you're just going to disable SSL validation, there's no reason to use the https endpoint at all.

Is there a reason why the trustedHosts property cannot be added in the .NET Runtime

We could consider adding this in a future release, but this wouldn't help you today. In any case, the use of disabling SSL validation is not a recommended pattern for production, and the iOS SDK property was unfortunately added first of all due to historic reasons and secondly (unfortunately) added outside the common API design that all the Runtimes have. Also due to the complexity having the .NET SDK being cross platform with vastly different underlying HTTP implementations, I'm honestly not even sure we can pull this property off and make it work everywhere.

0 Kudos
NathanJoraanstad
New Contributor

Sounds good. Thanks for the help! I'll talk with our server team and see if we can get our servers signed with a trusted authority.

Appreciate you taking the time to help. I'll let you know if we run into any more problems with regard to this.

Thanks!

0 Kudos
dotMorten_esri
Esri Notable Contributor

...btw it can be done for free using https://letsencrypt.org

0 Kudos