feat: custom disable ssl cert verf

Closes #88

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-02 14:13:13 +08:00
parent d0ef75bce7
commit f1a10a786d
4 changed files with 62 additions and 0 deletions

View File

@@ -52,6 +52,9 @@ void main() async {
],
);
}
if (GStorage.badCertificateCallback) {
HttpOverrides.global = _CustomHttpOverrides();
}
await setupServiceLocator();
Request();
await Request.setCookie();
@@ -275,3 +278,12 @@ class MyApp extends StatelessWidget {
);
}
}
class _CustomHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)
..badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
}
}