CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354)) Flutter

silsly
1 min readMar 19, 2021

I found this issue when running application in Android Version 19 (KitKat). Damage for this case, my application cannot request HTTP post (the result return null). Even though this application running well in Android Version above 20 (Lollipop).

Then i found this solution, maybe you can try it.

Solution :

  1. Reconfig SSLCertificateChainFile in Apache Server
  2. Forced allow all certificate when application running

I try the second solution, just add this codes…

try {
final ioc = new HttpClient();
ioc.badCertificateCallback = (X509Certificate cert, String host, int port) => true;
final http = new IOClient(ioc);
http.post('url', body: {"email": "xyz@xyz.com", "password": "1234"}).then((response) {
print("Reponse status : ${response.statusCode}");
print("Response body : ${response.body}");
var myresponse = jsonDecode(response.body);
String token = myresponse["token"];
});
} catch (e) {
print(e.toString());
}

--

--