wanandroid icon indicating copy to clipboard operation
wanandroid copied to clipboard

首页,体系,公众号,导航,项目无数据

Open yihaha opened this issue 5 years ago • 1 comments

E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: DioError [DioErrorType.DEFAULT]: HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate is not yet valid(handshake.cc:352)) null

yihaha avatar Mar 15 '19 05:03 yihaha

1、更新pubspec.yaml dio为 dio: ^2.1.0 2、修改DioManager类为

class DioManager { Dio _dio;

DioManager._internal() { _dio = new Dio(); (_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) { client.badCertificateCallback = (X509Certificate cert, String host, int port) { return true; }; }; }

static DioManager singleton = DioManager._internal();

factory DioManager() => singleton;

get dio { return _dio; } }

ngu2008 avatar Mar 15 '19 07:03 ngu2008