美文网首页
:DioError [DioErrorType.DEFAULT]

:DioError [DioErrorType.DEFAULT]

作者: focusHYD | 来源:发表于2020-11-02 11:28 被阅读0次

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

    相关文章

      网友评论

          本文标题::DioError [DioErrorType.DEFAULT]

          本文链接:https://www.haomeiwen.com/subject/jjapvktx.html