[Solved] Unhandled Exception: HandshakeException: Handshake error in client

preview_player
Показать описание
Today i came across this error while running my flutter app.
Unhandled Exception: HandshakeException: Handshake error in client

The code for the solution is

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

Paste this line in the main function

*Note: This should be used while in development mode, do NOT do this when you want to release to production, the aim of this answer is to make the development a bit easier for you, for production, you need to fix your certificate issue and use it properly, look at the other answers for this as it might be helpful for your case.

--- SUBSCRIBE HERE ---

SOCIAL MEDIA: Follow Me :-)

#Flutter #Tutorial #IntelliLogics
LIKE & SHARE & ACTIVATE THE BELL
Thanks For Watching :-)
Рекомендации по теме
Комментарии
Автор

This solution doesnt work. Try it with cellular data. You will take same error again. This solution works only local mode or wifi.

anonimousnb
Автор

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

blogypedia
Автор

Does this work when deployed for production too?
This seems like a workaround and it does work for me right now but I cant help but wonder if it does work for all too when its deployed in production server

fallzero
Автор

Thanks bro! This code defend on Null Safety. My App is running!

구미_반_박창준