Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yihaha opened this issue Mar 15, 2019 · 1 comment
Open

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

yihaha opened this issue Mar 15, 2019 · 1 comment

Comments

@yihaha
Copy link

yihaha commented Mar 15, 2019

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

@ngu2008
Copy link
Owner

ngu2008 commented Mar 15, 2019

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;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants