Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-11-17 12:42:42 +08:00
parent ad931d7ea2
commit aaab5371b2
2 changed files with 12 additions and 8 deletions

View File

@@ -368,14 +368,12 @@ class MyApp extends StatelessWidget {
}
class _CustomHttpOverrides extends HttpOverrides {
final badCertificateCallback = kDebugMode || Pref.badCertificateCallback;
@override
HttpClient createHttpClient(SecurityContext? context) {
final client = super.createHttpClient(context)
// ..maxConnectionsPerHost = 32
..idleTimeout = const Duration(seconds: 15);
if (badCertificateCallback) {
if (kDebugMode || Pref.badCertificateCallback) {
client.badCertificateCallback = (cert, host, port) => true;
}
return client;