[英]CERTIFICATE_VERIFY_FAILED: invalid or inconsistent certificate extension(handshake.cc.359)
This problem only occurs when running my app on Android (Emulator or Physical Device).只有在 Android(模拟器或物理设备)上运行我的应用程序时才会出现此问题。 It's fine on iOS.在iOS上没问题。
I'm getting this error when calling a GET request to my server protected with SSL.向受 SSL 保护的服务器调用 GET 请求时出现此错误。
HandshakeException: Handshake error in client (OS Error: I/flutter (11617): CERTIFICATE_VERIFY_FAILED: invalid or inconsistent certificate extension(handshake.cc:359))
The SSL Certificate is not self-signed. SSL 证书不是自签名的。 It is signed by my company's own isolated CA.它由我公司自己的独立 CA 签署。 And the CA is 3 tiers (1 root certificate and 2 intermediate certificates underneath). CA 有 3 层(下面有 1 个根证书和 2 个中间证书)。 The last intermediate authority is the one that signed the Server Certificate so the chain of trust is 3 levels.最后一个中间机构是签署服务器证书的机构,因此信任链是 3 个级别。
Certificate details证书详情
I have added the server certificate and the chain of trust to the app itself under my /assets/raw/ directory and have added these to my securityContext (using iOClient for making http calls)我已将服务器证书和信任链添加到我的 /assets/raw/ 目录下的应用程序本身,并将这些添加到我的 securityContext(使用 iOClient 进行 http 调用)
Flutter doctor results颤振医生结果
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-PH)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.57.1)
[✓] Connected device (3 available)
! Error: Gabe’s iPhone is busy: Copying cache files from device. Xcode will continue when Gabe’s iPhone is finished. (code -10)
• No issues found!
我通过向 android/app/src/debug/AndroidManifest.xml 添加一行来解决这个问题:
<application android:usesCleartextTraffic="true"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.