Making the ArcGISHttpClientHandler accept "invalid" certificates

939
2
Jump to solution
08-21-2018 07:34 AM
alehmann
New Contributor III

I'm trying to debug a problem with a customer's map service where we see intermittend errors in displaying the map. To get an idea as to why the map is sometimes not loading, I wanted to sniff the traffic using Fiddler. As the service is an SSL-secured service, I am using Fiddler's own certificate to intercept the connection and act as my own man-in-the-middle.

This works fine in my own code (using HttpClient) but crashes as soon as I try to show the map (both on Android and on iOS) with the following exception: 

System.Net.WebException: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “<customer's site>” which could put your confidential information at risk. ---> Foundation.NSErrorException: Exception of type 'Foundation.NSErrorException' was thrown.
--- End of inner exception stack trace ---

Is there any way to let the internal ArcGIS handler accept "invalid" certificates? If not, how am I able to capture the traffic between my app (on either Android or iOS) and the server?

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

You'd need to install the certificate that Fiddler generated. It does this for you on Windows where Fiddler is running, but you'd need to do this yourself on any other device.

Configure Fiddler for Android / Google Nexus 7 

Configure Fiddler for iOS 

View solution in original post

0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

You'd need to install the certificate that Fiddler generated. It does this for you on Windows where Fiddler is running, but you'd need to do this yourself on any other device.

Configure Fiddler for Android / Google Nexus 7 

Configure Fiddler for iOS 

0 Kudos
alehmann
New Contributor III

Hi Morten,

I did that but had the error nontheless. Strangely, the problem seems to have solved itself. Maybe all I needed was a reboot of the device... thanks for the answer, though!

0 Kudos