Skip to content

Commit

Permalink
Use Global Override to enable for CachedNetworkImages
Browse files Browse the repository at this point in the history
  • Loading branch information
Teifun2 committed Dec 26, 2020
1 parent c0b3dc5 commit bfc5e2f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/src/models/app_authentication.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:convert';
import 'dart:io';

import 'package:dio/adapter.dart';
import 'package:dio/dio.dart';
import 'package:nextcloud_cookbook_flutter/src/util/self_signed_certificate_http_overrides.dart';

Expand All @@ -24,13 +23,7 @@ class AppAuthentication {
authenticatedClient.options.headers["User-Agent"] = "Cookbook App";
authenticatedClient.options.responseType = ResponseType.plain;

if (selfSignedCertificate) {
(authenticatedClient.httpClientAdapter as DefaultHttpClientAdapter)
.onHttpClientCreate = (HttpClient client) {
client.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
};

if (!selfSignedCertificate) {
HttpOverrides.global = new SelfSignedCertificateHttpOverride();
}
}
Expand Down

0 comments on commit bfc5e2f

Please sign in to comment.