Menu

Fixing CERTIFICATE_VERIFY_FAILED in Flutter Windows apps (without disabling SSL)
📰

Fixing CERTIFICATE_VERIFY_FAILED in Flutter Windows apps (without disabling SSL)

DEV Community: dart·Ankur Kumar·3 days ago
#axGwGubT
#devtodart#devto#dev#certificate#server
Long article (1346 words) — no AI summary yet.
Reading 0:00
15s threshold

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).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.