main, fix cert issues on older versions of Android (before Let's Encrypt existed).
This commit is contained in:
1 parent
dd9d15172c
commit
436c96285c
1 file changed
+13
@@ -12,6 +12,11 @@ import 'package:alarm/alarm.dart';
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
// For trusting Let's Encrypt on older devices (SDK 24, Android 7)
|
||||
//import 'dart:io';
|
||||
//import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
|
||||
/// TBD:
|
||||
/// - Add other languages (Spanish, Croatian)
|
||||
/// v1.1.0
|
||||
@@ -22,6 +27,14 @@ import 'dart:convert';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final certData = await rootBundle.load(
|
||||
'media/certs/open-meteo-com_isrg-root-x1.pem',
|
||||
);
|
||||
SecurityContext.defaultContext.setTrustedCertificatesBytes(
|
||||
certData.buffer.asUint8List(),
|
||||
);
|
||||
|
||||
tz.initializeTimeZones();
|
||||
await Alarm.init();
|
||||
runApp(const SunsetAlarmApp());
|
||||
|
||||
Reference in new issue
Block a user