Your Flutter app talks to its API without problems on Android. Then you build the Windows desktop version, and every request fails with this:
HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:393))
Enter fullscreen mode
Exit fullscreen mode
The API opens fine in Chrome on the same machine. The certificate is valid, not expired, and issued by a well-known CA. So why does the app refuse it?
The most common answer online is to set badCertificateCallback to return true . That makes the error go away by switching off certificate checks entirely, which is the one thing HTTPS exists to do. This tutorial shows a better approach: find out why the handshake fails, then fix the actual cause.
Why the browser works and your app doesn't
On desktop, Flutter makes HTTPS requests through dart:io , which uses Dart's own TLS implementation (built on BoringSSL).…