question

786Code-8415 avatar image
0 Votes"
786Code-8415 asked RobCaplan edited

Xamarin.Forms App getting crashed when running in IOS 14.6 device and throwing exception as CertificateUnknown/The certificate for this server is invalid when calling API

Hi,

My Xamarin.Forms app is getting crashed after updating to IOS 14.6, where as it is working fine on the devices with lower versions.

Getting the following exceptions when trying to call API from IOS 14.6:
1. System.Net.WebException: CertificateUnknown
2. System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00013] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2029
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs,

System.AggregateException: Error Domain=NSURLErrorDomain Code=-XXXX "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “subdomain.domain.com” which could put your confidential information at risk." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=X, NSErrorPeerCertificateChainKey=( "<cert(XXXXX) s: *domain.com i: Go Daddy Secure Certificate Authority - G2>", "<cert(XXXXX) s: Go Daddy Secure Certificate Authority - G2 i: Go Daddy Root Certificate Authority - G2>" ), NSErrorClientCertificateStateKey=X, NSErrorFailingURLKey=https://subdomain.domain.com/api/Signin/Settings?SecurityCode=XXXXX, NSErrorFailingURLStringKey=https://subdomain.domain.com/api/Signin/Settings?SecurityCode=XXXXX, NSUnderlyingError=XXXXX {Error Domain=kCFErrorDomainCFNetwork Code=-XXXX"(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: XXXXX>, _kCFNetworkCFStreamSSLErrorOriginalValue=-XXXX, _kCFStreamErrorDomainKey=X, _kCFStreamErrorCodeKey=-XXXX, kCFStreamPropertySSLPeerCertificates=( "<cert(XXXXX) s: *sample.com i: Go Daddy Secure Certificate Authority - G2>", "<cert(XXXXX) s: Go Daddy Secure Certificate Authority - G2 i: Go Daddy Root Certificate Authority - G2>" )}}, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <XXXXX>.<1>" ), _kCFStreamErrorCodeKey=-XXXXX, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <XXXXXX>.<1>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: XXXXX>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “subdomain.domain.com” which could put your confidential information at risk.}

Below are the VS and other Version am have:
111208-image.png



NOTE: Facing this only in IOS 14.6 devices not in the lower versions and in Android.

dotnet-xamarin
image.png (48.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

786Code-8415 There may be many reasons for this issue. Here found a similar thread maybe you can refer to.

0 Votes 0 ·

0 Answers