未经手的例外:handshakeException:客户端中的握手错误(OS错误:证书_verify_failed:证书已过期(Handshake.cc:393))

发布于 2025-02-09 19:23:39 字数 475 浏览 1 评论 0原文

我在较旧版本的Android -5.1上启动我的应用程序,并且我遇到了此错误:

Unhandled Exception: HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393))

在较新的Android上,它没有出现。 我正在向后端提出发布请求,如何解决?

我找到了解决方案:在这里说明

I launch my app on older version of Android - 5.1 and I am getting this error:

Unhandled Exception: HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393))

On newer Android like 10 this is not appearing.
I am making POST request to my backend, how to fix it?

I found solution: enter link description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香橙ぽ 2025-02-16 19:23:39

尝试这个

   class MyHttpOverrides extends HttpOverrides{
  @override
  HttpClient createHttpClient(SecurityContext context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
  }
}

void main(){
  HttpOverrides.global = new MyHttpOverrides();
  runApp(MyApp());
}

我不确定flutter网的不确定,但它可能有助于扑动iOS和Android。

Try this one

   class MyHttpOverrides extends HttpOverrides{
  @override
  HttpClient createHttpClient(SecurityContext context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
  }
}

void main(){
  HttpOverrides.global = new MyHttpOverrides();
  runApp(MyApp());
}

I am not sure about flutter web but it may help flutter ios and android.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文