App Transport Security has blocked a cleartext HTTP load Flutter / Dart Origin: On your device Last updated 4 Nov 2026

iOS: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection (NSURLErrorDomain -1022)

iOS blocks plain HTTP connections by default unless the domain is allowed in Info.plist.

Exact message you may see App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecureNSURLErrorDomain error -1022The resource could not be loaded because the App Transport Security policy requires the use of a secure connectionATS blocked cleartext
Seen on: Flutter iOS

Meaning

ATS requires HTTPS with modern TLS. Move the server to HTTPS. For development only, add an NSExceptionDomains entry for the specific host in ios/Runner/Info.plist; avoid NSAllowsArbitraryLoads in production because App Review asks for justification.

Common causes

  • Calling an http:// URL from iOS
  • Server TLS older than 1.2 or weak ciphers
  • Redirect to HTTP
  • Local dev server by IP
  • Third-party SDK using cleartext

⚡ Quick fix

  1. Use HTTPS with a valid certificate
  2. Add a domain-specific ATS exception for dev
  3. Test with nscurl --ats-diagnostics https://host

Detailed fix by platform

iOS

  1. Info.plist → NSAppTransportSecurity → NSExceptionDomains → <host> → NSExceptionAllowsInsecureHTTPLoads = true

How to diagnose

  1. URL — https?
  2. TLS — 1.2+?
  3. Exception — Scoped to the host?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cleartext HTTP traffic not permitted — Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted (Flutter / Dart)Cleartext HTTP traffi…CocoaPods: pod install failed / not installed — Flutter iOS: Error running pod install — CocoaPods not installed or out of date / [!] CocoaPods could not find compatible versions for pod (Flutter / Dart)CocoaPods: pod instal…HandshakeException: CERTIFICATE_VERIFY_FAILED — Dart: HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate) (Flutter / Dart)HandshakeException: C…Module 'x' not found (iOS build) — Xcode: Module 'firebase_core' not found — flutter build ios fails after adding a plugin (Flutter / Dart)Module 'x' not found …NetworkImageLoadException: HTTP request failed, statusCode: 404 — Flutter: Exception caught by image resource service — NetworkImageLoadException: HTTP request failed, statusCode: 404, https://example.com/a.png (Flutter / Dart)NetworkImageLoadExcep…NetworkOnMainThreadException — android.os.NetworkOnMainThreadException (Android)NetworkOnMainThreadEx…No profiles for 'x' were found — Xcode: No profiles for 'com.example.app' were found: Xcode couldn't find any iOS App Development provisioning profiles matching (Flutter / Dart)No profiles for 'x' w…NSURLErrorDomain Code=-1001 — Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." (iOS)NSURLErrorDomain Code…App Trans…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.