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
Step 2 :
call MyHttpOverrides class form your main function
HttpOverrides.global = MyHttpOverrides();