Handshake exception: Handshake error in client(OS Error : CERTIFICATE_VERIFY_FAILED) fix this error in flutter.

Handshake exception: Handshake error in client(OS Error : CERTIFICATE_VERIFY_FAILED) fix this error in flutter.

Hello Readers

Today I will show you how you can fix Handshake exception OS error in flutter.

Follow me and apply these steps :-

Step 1 :

open your main.dart file

and add MyHttpOverrides class

class MyHttpOverrides extends HttpOverrides {
  @override
  HttpClient createHttpClient(SecurityContext? context) {
    return super.createHttpClient(context)
      ..badCertificateCallback =
          (X509Certificate cert, String host, int port) => true;
  }
}

It will look something like this

Screenshot at 2022-04-01 01-09-13.png

Step 2 :

call MyHttpOverrides class form your main function

  HttpOverrides.global = MyHttpOverrides();

It will look something like this

Screenshot at 2022-04-01 00-53-54.png

Now You error has been Fixed