mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Fix HTTPs issue
This commit is contained in:
parent
f16480092b
commit
8300fc8ca9
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:comunic/main.dart';
|
import 'package:comunic/main.dart';
|
||||||
import 'package:comunic/models/config.dart';
|
import 'package:comunic/models/config.dart';
|
||||||
|
|
||||||
@ -5,6 +7,17 @@ import 'package:comunic/models/config.dart';
|
|||||||
///
|
///
|
||||||
/// @author Pierre HUBERT
|
/// @author Pierre HUBERT
|
||||||
|
|
||||||
|
/// Fix HTTPS issue
|
||||||
|
class MyHttpOverride extends HttpOverrides {
|
||||||
|
@override
|
||||||
|
HttpClient createHttpClient(SecurityContext context) {
|
||||||
|
return super.createHttpClient(context)
|
||||||
|
..badCertificateCallback = (cert, host, port) {
|
||||||
|
return host == "devweb.local"; // Forcefully trust local website
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
Config.set(Config(
|
Config.set(Config(
|
||||||
apiServerName: "192.168.1.9:3000",
|
apiServerName: "192.168.1.9:3000",
|
||||||
@ -15,5 +28,7 @@ void main() {
|
|||||||
termsOfServicesURL: "http://devweb.local/comunic/current/about.php?cgu",
|
termsOfServicesURL: "http://devweb.local/comunic/current/about.php?cgu",
|
||||||
));
|
));
|
||||||
|
|
||||||
|
HttpOverrides.global = new MyHttpOverride();
|
||||||
|
|
||||||
subMain();
|
subMain();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user