CERTIFICATE_VERIFY_FAILED error while performing a POST request in Flutter

Sometimes Flutter/Dart shows random CERTIFICATE_VERIFY_FAILED error. Mostly it happens when try to request POST or fetch images. Below are simple steps to avoid this error.

In your main.dart file, add or import the following class:

In your main function, add the following line after function definition:

Happy coding😊

I convert the dream into code

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How To Manage Your Google Contacts

Understanding Elements | Chapter 2

Introduction to Binary Search Algorithm

How from technology we wanted to support in the containment of COVID-19

Just Getting Started with Kevin Lin, Founder and CEO of Dendron

When should you invest in custom-built software?

Grading Myself Honestly on the “Programmer Competency Matrix”

How Much Does It Cost To Develop An NFT Application In Canada? | Hyperlink InfoSystem

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
aslam mac

aslam mac

I convert the dream into code

More from Medium

Flutter: Enable Web support for an existing app

What are the opportunities of big data for flutter developers? Part 2

How To Navigate from One Screen To Second Screen in Flutter

How to easily use Duolingo API in Dart & Flutter application