# HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: ok(handshake.cc:393))

- **ID:** `flutter/dart-io-ssl-handshake-error`
- **Domain:** flutter
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

SSL certificate verification failed, typically due to a self-signed certificate, expired certificate, or missing intermediate CA in the device's trust store.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Flutter 3.10 | active | — | — |
| Dart 3.0 | active | — | — |
| iOS 16 | active | — | — |
| Android 13 | active | — | — |

## Workarounds

1. **Add the self-signed certificate to the device's trust store, or use a proper CA-signed certificate on the server.** (80% success)
   ```
   Add the self-signed certificate to the device's trust store, or use a proper CA-signed certificate on the server.
   ```
2. **If testing only, use a custom HttpClient with badCertificateCallback that validates the specific certificate fingerprint.** (70% success)
   ```
   If testing only, use a custom HttpClient with badCertificateCallback that validates the specific certificate fingerprint.
   ```

## Dead Ends

- **** — Disables all certificate validation, creating a security vulnerability and may still fail on some platforms due to other TLS checks. (80% fail)
- **** — The underlying SSL issue persists; retrying without fixing the certificate chain will produce the same error. (90% fail)
- **** — The http package also relies on dart:io's underlying TLS implementation; the error will be identical. (70% fail)
