:DioError [DioErrorType.DEFAULT]

2020-11-02  本文已影响0人  focusHYD

最近换了一个安卓4.4的手机开发遇到如下报错
:DioError [DioErrorType.DEFAULT]: HandshakeException: Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354)) 无法获取本地证书

解决:
添加如下代码 强行信任
Dio dio = Dio();
(dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client){
client.badCertificateCallback=(cert, host, port){
return true;
};
};

上一篇下一篇

猜你喜欢

热点阅读