Cuando hago una petición al servidor de desarrollo me arroja el siguiente error.
[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error:
E/flutter ( 6061): CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))
El código:
//Login con apirest laravel
import 'package:http/http.dart' as http;
Future<Map<String, dynamic>> login(String email, String password) async {
final url = Uri.https(_url, '/login');
var pass = generateSha1(generateMd5(password));
final response = await http.post(url, body: {
'email': email,
'password': pass
});
print(response.body);
Map<String, dynamic> decodeData = json.decode(response.body);
if (decodeData.containsKey('token')) {
return {'ok': true, 'token': decodeData['token']};
} else {
return {'ok': false, 'mensaje': decodeData['error']};
}
}