Map didn't load when choose 'trustHostAndContinue' on iOS

829
3
11-30-2019 08:55 PM
ThinhNguyen1
New Contributor

Hi all, I got a problem:

- When I using base map with my local server, a pop up appear with title: "Can not verify the identity of 'XXX'" and the message is: "The server's certificate is invalid. You might be connecting to a server that is pretending to be 'XXX', which could put your confidential information at risk. Would you like to connect any way?", then I choose 'Continue' but the map didn't load anymore.

- I tried to implement the AGSAuthenticationManager delegate and adding trustHostAndContinue but the map not working anymore.

Please help me, thank you.

Tags (2)
0 Kudos
3 Replies
NimeshJarecha
Esri Regular Contributor

Hello Thinh,

Looks like you are using the self-signed certificate on the server. Apple has updated their requirement for the certificates on the server. Please go through below link and make sure your certificate matches the requirement.

Requirements for trusted certificates in iOS 13 and macOS 10.15 - Apple Support  

Just to try, can you add the `App Transport Security Settings` in your info.plist file with either setting the `NSAllowsArbitraryLoads = YES` or setting exception of your server with `NSExceptionAllowsInsecureHTTPLoads = YES`? Does it work?

Please refer details of setting the `App Transport Security Settings` in below link.

Preventing Insecure Network Connections | Apple Developer Documentation 

Hope this helps!

Regards,

Nimesh

ThinhNguyen1
New Contributor

Thanks for your help,

I tried to implement privacies in the plist file but it seems no working.

Btw, my device is running iOS 12.4.3

I attached my plist configuration image and the authentication delegate for better understanding.

0 Kudos
NimeshJarecha
Esri Regular Contributor

Since you have added `Allow Arbitrary Loads = YES`, try removing the `Exception Domains`?

Also, challenge has a type property, you should call `trustHostAndContinue` only if the `challenge.type == .untrustedHost`.

Also, what is the error when layer fails to load?

Regards,

Nimesh

0 Kudos