最近换了一个安卓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;
};
};
网友评论