From 1f5d82e9d9a0cfd19b6c1841ac4ebb3ebff76521 Mon Sep 17 00:00:00 2001
From: Kedas <m@yarn.network>
Date: Fri, 24 May 2024 02:16:14 -0700
Subject: [PATCH] fix(mobile): respect SSL override during background sync
 (#9587)

---
 mobile/lib/services/background.service.dart | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mobile/lib/services/background.service.dart b/mobile/lib/services/background.service.dart
index 8e451cc271..ba8f5c01ed 100644
--- a/mobile/lib/services/background.service.dart
+++ b/mobile/lib/services/background.service.dart
@@ -20,6 +20,7 @@ import 'package:immich_mobile/entities/store.entity.dart';
 import 'package:immich_mobile/services/api.service.dart';
 import 'package:immich_mobile/utils/backup_progress.dart';
 import 'package:immich_mobile/utils/diff.dart';
+import 'package:immich_mobile/utils/http_ssl_cert_override.dart';
 import 'package:isar/isar.dart';
 import 'package:path_provider_ios/path_provider_ios.dart';
 import 'package:photo_manager/photo_manager.dart';
@@ -590,6 +591,7 @@ enum IosBackgroundTask { fetch, processing }
 /// entry point called by Kotlin/Java code; needs to be a top-level function
 @pragma('vm:entry-point')
 void _nativeEntry() {
+  HttpOverrides.global = HttpSSLCertOverride();
   WidgetsFlutterBinding.ensureInitialized();
   DartPluginRegistrant.ensureInitialized();
   BackgroundService backgroundService = BackgroundService();