I am using the ArcGIS SDK for .Net 8.0 in my Xaml App. When trying to get authenticate user using this function, await AuthenticationManager.Current.GenerateCredentialAsync I am getting SSL error. I am unable to find a sample code that illustrates how we attach HttpClient handler to the ArcGISRuntime or alternative way of supplying client cert with when the server certificate validation happens.
I am using Visual Studio 2022 and targeting to Android 15.0.
Solved! Go to Solution.
As mentioned in this thread Certificate Trust Issue using Domain CA for VPN connected App there is a method RemoteCertificateValidationCallback on AuthenticationManager which gets called on validation.
In iOS you also need to add information to the info.plist if you are using a non-public domain
Thanks @JoeHershman it helped to move forward with this to make sure the device can connect to the portal. We will now add client cert validation logic to ensure it is secured.
AuthenticationManager.Current.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
As mentioned in this thread Certificate Trust Issue using Domain CA for VPN connected App there is a method RemoteCertificateValidationCallback on AuthenticationManager which gets called on validation.
In iOS you also need to add information to the info.plist if you are using a non-public domain
Thanks @JoeHershman it helped to move forward with this to make sure the device can connect to the portal. We will now add client cert validation logic to ensure it is secured.
AuthenticationManager.Current.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
Just to add a note to this: The above code is totally fine for testing, but don't deploy this into production since you'd completely bypass all SSL checks by always returning true here. You could improve it a little by at least only returning true for the specific endpoint with the very specific certificate you'd expect from that server.