One of my customers is getting a CERTIFICATE_VERIFY_FAILER error when the app attempts an https post to our production API service. The service is signed with a valid CA. It has only been reported by one person so far.
Error from exception: HandshakeException: Handshake error in client (OE Error: CERTIFICATE_VERIFY_FAILER: self signed certificate in certificate chain (handshake.cc:352))
The customer did a factory reset, but it didn't fix it. They are using the app on a Samsung S6. They have two other phones on the same wifi that works fine. The issue occurs both on wifi and cell data. I tried upgrading to the latest version of flutter (v1.6.3-pre.15). They are still reporting the issue. I've been unable to reproduce this on an emulator. Also the app is working on other Samsung S6 devices.
I also verified the ssl cert using https://www.sslshopper.com/ssl-checker.html#hostname=prod.mapdot.net
Here is the code that is throwing the exception:
static Future<String> mapDotSignIn(String usr, String pass) async {
final url = ApiHelper.RootUrl + "Login/Login";
try {
Map<String, dynamic> json = new Map<String, dynamic>();
json['user'] = usr;
json['pass'] = pass;
var jsonStr =jsonEncode(json);
var resp = await http.post(url,
headers: {"Content-Type": "application/json"}, body: jsonStr);
Map<String, dynamic> respMap = jsonDecode(resp.body);
return respMap['token'];
} catch (e) {
return 'Error: ' + e.toString();
}
}
I was considering adding ..badCertificateCallback to the call, but I'd rather avoid that unless there is no other way. Any ideas what might cause this?