.NET MAUI iOS App Transport Security (ATS) SSL Error After Migration

PavanKumar Bandi 0 Reputation points
2024-12-10T08:20:21.15+00:00

Encountering SSL error after migrating an app from Xamarin.Forms to .NET MAUI.

Below are the logs:

ATS failed system trust   
Connection 8: system TLS Trust evaluation failed(-9802)   
Connection 8: TLS Trust encountered error 3:-9802   
Connection 8: encountered error(3:-9802)   
Task <26AE8D3E-5A73-4665-866C-26630964D035>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802])   
Task <26AE8D3E-5A73-4665-866C-26630964D035>.<1> finished with error [-1200]   
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made."   
UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=(

In Xamarin.Forms, this issue was bypassed without any problems. However, in .NET MAUI, the error persists despite adding the following to the Info.plist file:

<key>NSAppTransportSecurity</key> 
<dict>   
    <key>NSAllowsArbitraryLoads</key>   
    <true/>   
    <key>NSAllowsArbitraryLoadsInWebContent</key>   
    <true/> 
</dict>

Ignore SSL certificate errors
What might be missing in the migration? Any help would be greatly appreciated.

Developer technologies | .NET | .NET MAUI
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.