NSURLErrorDomain Code=-1202 with message Invalid Server Certificate.

I develop an app using MTLS, following the Apple's certificates criteria, but I'm getting the error "The certificate for this server is invalid", code=-1202 when I try to do the HTTP request that will trust the client's certificate, unable to complete the request. What I noticed is that this error occurs on versions 13 and 14 of the iOS and it's intermittent. Is there a way to get more details about what is happened on the client's side?

Error -1202 is NSURLErrorServerCertificateUntrusted, which indicates a problem with the client’s trust evaluation of the server.

Is there a way to get more details about what is happened on the
client's side?

You have a bunch of options, depending on the specific API you’re using. What is that?

it's intermittent.

My experience is that iOS’s server trust evaluation is very consistent, so intermittent problems like this are almost always caused by a server-side problem. For example, your server might actually be a group of servers behind some sort of load balancing system. If one of those servers is misconfigured, you see intermittent problems like this.

An RVI packet trace can be really useful in tracking down these issues.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
NSURLErrorDomain Code=-1202 with message Invalid Server Certificate.
 
 
Q