0
votes

I have a problem when I run a call to the web service iOS project, only in the production url (HTTPS). In homologation Url (HTTP) the call to the web service works perfectly, but when I switch to production url (HTTPS) the application crashes. Only iOS. My output:

Thread finished: #10 The thread 0xa has exited with code 0 (0x0). Thread finished: #11 The thread 0xb has exited with code 0 (0x0). Thread finished: #6 The thread 0x6 has exited with code 0 (0x0). 2018-03-28 04:34:13.362 AppNivel.iOS[4830:44384] Unhandled Exception: System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: TrustFailure (One or more errors occurred.) ---> System.AggregateException: One or more errors occurred. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Security.Interface.TlsException: CertificateUnknown at Mono.AppleTls.AppleTlsContext.EvaluateTrust () [0x000ca] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs:269 at Mono.AppleTls.AppleTlsContext.RequirePeerTrust () [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs:210 at Mono.AppleTls.AppleTlsContext.ProcessHandshake () [0x00046] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/mcs/class/System/Mon o.AppleTls/AppleTlsContext.cs:186 at ...

at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/UIKit/UIApplication.cs:63 at AppNivel.iOS.Application.Main (System.String[] args) [0x00001] in D:\AppNivel_Bkp_14032018_1450h\AppNivel\AppNivel.iOS\Main.cs:17 2018-03-28 04:34:13.366 AppNivel.iOS[4830:44384] Unhandled managed exception: An error occurred while sending the request (System.Net.Http.HttpRequestException) at System.Net.Http.HttpClientHandler+d__64.MoveNext () [0x0046c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs:406 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/mcs/class/referencesource/msco rlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.8.0.20/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 at ...

2018-03-28 04:34:13.401 AppNivel.iOS[4830:44384] critical:

Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

The app has been terminated.

1

1 Answers

0
votes

It might cauesd by the certifcations when using HTTPS.

You can use third-party plugin to request HTTPS.

For example, modernhttpclient , it can solve the certifcations issue.

Refer to here