Http Error “CERTIFICATE_VERIFY_FAILED: not able to get native issuer certificates”

Hi all,

I’m writing a Flutter App and made my backend api in ASP .NET Core 6. Lately I host it by the use of localhost. I’m somewhat bit misplaced at the present time as a result of I all the time get this mistake.

This mistake occurs once I wish to debug on Android Emulator.

[My error](https://preview.redd.it/lapmyqtozzr91.png?width=1129&format=png&auto=webp&s=207258088609ce6818376b08da394a986e025360)

Now I googled somewhat and located a Stackoverflow web page the place they are saying I will allow a badCertificateCallback globally which I’m simplest allowed to make use of in developement. However it’s extra roughly a workaround I feel. There may be a solution so as to add a certificates to the property folder of the foundation undertaking folder. I did it and likewise did the whole lot step-by-step however I nonetheless get the mistake that it can’t get the certificates.

​

[Stackoverflow solution](https://preview.redd.it/m7gwtw7d00s91.png?width=1123&format=png&auto=webp&s=211d2f4ea9154abbe57709bc37a9e642065bb6de)

**My Challenge:**

This serve as fails on “go back look forward to http.get …”

static Long run<http.Reaction> userLogin(String mail, String password) async{
ultimate params = {
‘mail’:mail,
‘password’:password
};
ultimate header = {
HttpHeaders.contentTypeHeader: ‘software/json’,
};
var uri = Uri.https(‘10.0.2.2′,’api/authentication/login’, params);
go back look forward to http.get(uri, headers: header).timeout(const Period(seconds: 10));
}

&#x200B;

[the certificate I added](https://preview.redd.it/sa0hvmlq00s91.png?width=625&format=png&auto=webp&s=90339ace98b55c346bd26e8e65f9fcf61b1a03db)

&#x200B;

[the added asset directory in the pubspec.yaml](https://preview.redd.it/594y664u00s91.png?width=1021&format=png&auto=webp&s=30952fd3f69ac80bfeef7699924cbceb2f56e457)



View Reddit by means of MettwurstpowerView Supply

You may also like...

WP2Social Auto Publish Powered By : XYZScripts.com