Skip to content

Instantly share code, notes, and snippets.

@bylatt
Created August 7, 2022 11:39
Show Gist options
  • Save bylatt/8a9a90ca084bdc7cbefc17b3b0a4621b to your computer and use it in GitHub Desktop.
Save bylatt/8a9a90ca084bdc7cbefc17b3b0a4621b to your computer and use it in GitHub Desktop.
Dio initDioClient() {
final dio = Dio();
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
client.badCertificateCallback = (X509Certificate cert, String host, int port) => true;
};
return dio;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment