Eu estou em dúvida com relação a esse erro.
Aqui vai uma print do código junto com o problema:
import 'package:http/http.dart';
import 'package:http_interceptor/http_interceptor.dart';
class LoggingInterceptor implements InterceptorContract {
@override
Future<RequestData> interceptRequest({required RequestData data}) async {
print("Request: ");
print("url: ${data.url}");
print("headers: ${data.headers}");
print("body: ${data.body}");
return data;
}
@override
Future<ResponseData> interceptResponse({required ResponseData data}) async {
print("Response: ");
print("status code: ${data.statusCode}");
print("headers: ${data.headers}");
print("body: ${data.body}");
return data;
}
}
void findAll() async {
final Client client = InterceptedClient.build(
interceptors: [LoggingInterceptor()],
);
final Response response =
await client.get(Uri.https("192.168.15.9", "transactions"));
print(response);
}
Mudei pra https e está apresentando esse erro agora:
Performing hot restart...
Syncing files to device AOSP on IA Emulator...
Restarted application in 2.895ms.
I/flutter (30437): Request:
I/flutter (30437): url: https://192.168.15.9/transactions
I/flutter (30437): headers: {}
I/flutter (30437): body:
E/flutter (30437): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error:
E/flutter (30437): CERTIFICATE_VERIFY_FAILED: self signed certificate(handshake.cc:359))
E/flutter (30437):