NSURLErrorServerCertificateUntrusted (code -1202) — the iOS/macOS Foundation Network layer rejected the server SSL cert. Cause: self-signed, expired, untrusted CA, empty SAN, or cert does not satisfy ATS (App Transport Security) requirements. In 2026 iOS requires TLS 1.2+, forward secrecy, SHA-256+ signature. Fix: real cert from Let's Encrypt/Sectigo, or for dev — NSAllowsArbitraryLoads (NOT production).
Below: causes, fixes, FAQ.
Free online tool — SSL certificate checker: instant results, no signup.
urlSession:didReceiveChallenge:NSAppTransportSecurity > NSExceptionDomains for a specific domain (careful)NSURLErrorServerCertificateUntrusted (-1202) indicates that your iOS or macOS device does not trust the SSL certificate presented by a server. This can occur due to expired certificates, unrecognized Certificate Authorities (CAs), or mismatched domain names. To resolve this issue, verify the certificate chain, ensure it is correctly configured, and check for any certificate revocation status using tools like OpenSSL or your browser's developer tools.
The NSURLErrorServerCertificateUntrusted error occurs when an application on iOS or macOS attempts to establish a secure connection and the SSL certificate presented by the server cannot be verified as trustworthy. This verification process involves several steps, including checking the certificate's validity period, the CA that issued the certificate, and whether the domain name matches the certificate.
When a device encounters an untrusted certificate, it will typically display a warning to the user, indicating that the connection is not secure. This error can stem from various issues:
To diagnose and resolve this issue, developers should use tools such as OpenSSL to inspect the certificate chain. The command openssl s_client -connect example.com:443 -showcerts can be executed in the terminal to view the certificate details and identify potential problems.
To resolve the NSURLErrorServerCertificateUntrusted (-1202) error, follow these steps:
openssl s_client -connect example.com:443 -servername example.comInspect the output for the notAfter field to confirm the certificate's expiration date.
/etc/ssl/certs directory on macOS.func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { let serverTrust = challenge.protectionSpace.serverTrust if let serverTrust = serverTrust { completionHandler(.useCredential, URLCredential(trust: serverTrust)) } else { completionHandler(.performDefaultHandling, nil) } } }By following these steps, you can effectively troubleshoot and resolve the NSURLErrorServerCertificateUntrusted (-1202) error, ensuring secure connections for your iOS or macOS applications.
SSL/TLS is the encryption protocol that protects data between the browser and server. Our tool analyzes the certificate, chain of trust, TLS version, and knownvulnerabilities.
Issuer, validity period, signature algorithm, covered domains (SAN), and validation type (DV/OV/EV).
Full chain verification: from leaf certificate through intermediates to root CA.
Protocol version (TLS 1.2/1.3), cipher suites, Perfect Forward Secrecy (PFS) support.
Set up a monitor — get Telegram and email alerts 30/14/7 days before expiration.
SSL certificate monitoring
TLS config audit
HTTPS as ranking factor
customer trust
www and subdomains.Strict-Transport-Security header forces browsers to always use HTTPS.SSL certificate monitoring, check history and alerts 30 days before expiry.
Sign up freeInfo.plist → NSAppTransportSecurity → NSExceptionDomains → your-dev-domain → NSExceptionAllowsInsecureHTTPLoads=YES. Debug builds only.
SHA-256 cert hash or SPKI pin. Rotate with the cert, validate on every build.
Yes, Foundation by default. Needs a custom trust eval via URLSessionDelegate.
TLS 1.2+, ECDHE forward secrecy, AES-128-GCM+, SHA-256 signature. Cert with SAN (mandatory).
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.